You really have two choices, get a 14 day JR pass, or piece the transportation together using buses, ferrys, and a Shikoku 4 day pass.
Either way, you will probably need an IC prepaid card, probably the ICOCA.
The JR Pass is great for long distance travel, which you do about 4 times. The first two times is to and from Takayama, the second two times is to Matsuyama. Yes, you will reposition from Kyoto to Osaka, but that is a minor expense.
You will be able to get around a little bit with the JR Pass in Osaka and Kyoto, but you will end up needing to take a bus or a subway to get somewhere, and that is where the ICOCA card will be used.
The other option is taking a Nohi bus to and from Takayama, and then using a ferry to get to Shikoku Island from Wakayama or Kobe, and getting a 4 day Shikoku Pass for 7900 yen. The Wakayama to Tokushima is what I would suggest. Here are some links to help you figure out what you want to do:
Nohi Bus:
http://www.nouhibus.co.jp/english/index.htmlFerry Information:
http://www.japan-guide.com/e/e2355_01.htmlShikoku Pass:
http://www.japan-guide.com/e/e2357_shikoku.htmlBy the way, if you do decide to get the 14 day JR Pass, you might think about getting the first class green pass. I have been told that the train ride to Takayama is very scenic, and I have been on the Limited express from Okayama to Matsuyama, and it is also quite scenic. The first class seats are on the first and last cars of the train, and the front and rear of the train, and you will be able to see out the front or rear of the train. Along with the windows on either side of the train, you get a pretty large view of the land (and water) around you.
Try to get the first row on the right hand side, for a less obstructed view. You will also need to ask which direction the train will be traveling, so that you can figure out if you want the first or last car.