In 君が代, what's the function of の?


I've got a question about the two instances of の in 君が代:

> さざれ石の巌となりて  
>  苔の生すまで

First, is さざれ石の巌 to be interpreted as _a boulder made of pebbles_ (analogous
to, say, 木製の槍)?

Second, is the の in 苔の生すまで essentially が, akin to the が/の alternation in
relative clauses:

> 太郎の焼いた魚 / 太郎が焼いた魚

If so, at what stage of the development of Japanese was this alternation
possible outside of relative clauses?

(Bonus: what stage of Japanese does 君が代 even reflect and why? I know it was
cobbled together in the Meiji period; [the Wikipedia
article](http://en.wikipedia.org/wiki/Kimigayo) says it's based on a waka from
the Heian period, but doesn't provide the original text.)




Turning comments into an answer. Credit should go all to the commenters on
original question!

[Choko](https://japanese.stackexchange.com/users/1016/choko):

> 「さざれ石(=細かい石)が巌【いわお】(=大きな岩)になって、(それに)苔【こけ】が[生]{む}す(=苔が生【は】える)まで。」って意味です。

[jogloran:](https://japanese.stackexchange.com/users/816/jogloran)

> Is the fact that が=の in this text commonly known to ordinary Japanese
> speakers?

[Choko](https://japanese.stackexchange.com/users/1016/choko):

> 私学の中高に通っていた大学生は結構知らなかったりしますね・・・
>
> College students that went to private junior and high schools often aren't
> aware of it...

