I'd like to port/write something similar to xv6 for Sparc http://pdos.csail.mit.edu/6.828/xv6/ at some point but the Sparc section of the wiki isn't much help and nether is this IMO http://www.cheesecake.org/sac/os-supp/ quite frankly but its better than nothing.
So is there anyone in the forum that could help me get as far as getting a kernel running in qemu? There just aren't any tutorials on the topic besides that one and it is quite old and requires that uboot think which I do not believe is even releated to the modern uboot.
I suppose the silo source code is somewhat useful from what I can tell the only useful assemblers around for sparc is the one on solaris and gas correct me if I am wrong on that. I mean there just isn't much info at all on the topic and specifics of gas with regard to sparc and the sun assembler isn't really an option (though I do have solaris 2.6 7 8 and 10 I just don't want to go that route). I have quite a few SparcStations 32 bit and 64 I can test code on. I lean toward the 32 bit ones though and anything I write in 32 bit would run on either so I plan on sticking to 32bit for simplicity.
I did find this so it should get me going on GNU as to begin with
http://www.cs.unm.edu/~maccabe/classes/ ... abman.html
I'll eventually just give in and start reading Linux/BSD code to figure out how its done but I really wouldn't mind some help. I see it as a sort of needed thing to as there aren't any really simple Sparc kernels out there.
qemu-system-sparc!
20Mhz SS2
40Mhz SS2 weitek upgrade
50, 2x50 or 60Mhz SS10
70Mhz SS5.
167Mhz Ultra 1E
and a 440Mhz ultra 10 which is actually rather nice.
I also have a hacked up 411 Scsi cdrom drive housing the drive out of the Ultra1 in a rather cramped but highly functional manner if I ever want to test boot cds.
And yes I am just learning kernel programing and in my free time at that but just have no motivation to learn about x86
Sparc kernel help needed
Re: Sparc kernel help needed
Serial device is a SAB82532. Datasheet available on google. It's located at a fixed address, but it's through a bus bridge so is slightly tenuous to calculate (offset X inside bridge, means you need to add the bridge window Y to access its registers). Best way to get that is the SILO code.cb88 wrote:I'd like to port/write something similar to xv6 for Sparc http://pdos.csail.mit.edu/6.828/xv6/ at some point but the Sparc section of the wiki isn't much help and nether is this IMO http://www.cheesecake.org/sac/os-supp/ quite frankly but its better than nothing.
So is there anyone in the forum that could help me get as far as getting a kernel running in qemu? There just aren't any tutorials on the topic besides that one and it is quite old and requires that uboot think which I do not believe is even releated to the modern uboot.
I suppose the silo source code is somewhat useful from what I can tell the only useful assemblers around for sparc is the one on solaris and gas correct me if I am wrong on that. I mean there just isn't much info at all on the topic and specifics of gas with regard to sparc and the sun assembler isn't really an option (though I do have solaris 2.6 7 8 and 10 I just don't want to go that route). I have quite a few SparcStations 32 bit and 64 I can test code on. I lean toward the 32 bit ones though and anything I write in 32 bit would run on either so I plan on sticking to 32bit for simplicity.
I did find this so it should get me going on GNU as to begin with
http://www.cs.unm.edu/~maccabe/classes/ ... abman.html
I'll eventually just give in and start reading Linux/BSD code to figure out how its done but I really wouldn't mind some help. I see it as a sort of needed thing to as there aren't any really simple Sparc kernels out there.
qemu-system-sparc!
20Mhz SS2
40Mhz SS2 weitek upgrade
50, 2x50 or 60Mhz SS10
70Mhz SS5.
167Mhz Ultra 1E
and a 440Mhz ultra 10 which is actually rather nice.
I also have a hacked up 411 Scsi cdrom drive housing the drive out of the Ultra1 in a rather cramped but highly functional manner if I ever want to test boot cds.
And yes I am just learning kernel programing and in my free time at that but just have no motivation to learn about x86
Watch out for linux' interrupt code, it'll handle interrupts by re-raising them as softints then iretting immediately. Bit of a weird way to do it. Also, linux' TLB insert code assumes that the MMU automatically clears the lowest 12 bits - shouldn't be relied upon, is hardware specific.
Solaris would be better to look at, tbh.
</someone who was helping to write a SPARC emulator as a job>
Re: Sparc kernel help needed
@JamesM cool thats very helpful thanks for the tips ... I'll probably be leaning more on BSD code than Linux though if I can its not like am more familiar with either one source wise.
I get the impression that people don't like gnu as syntax but what ever it doesn't look that much different but perhaps a bit more verbose... I might change my mind later on though heh. you never know it probably wouldn't be hard to write a front end to make the gas syntax nice
I get the impression that people don't like gnu as syntax but what ever it doesn't look that much different but perhaps a bit more verbose... I might change my mind later on though heh. you never know it probably wouldn't be hard to write a front end to make the gas syntax nice
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Sparc kernel help needed
Actually, people don't like gnu x86 syntax because it shows no resemblance to the original manufacturer's syntax, yielding two camps and the occasional religious debate. For most other architectures, gas' syntax is pretty close to the syntax shown in the architecture/processor manual and the problem does not arise, and I haven't seen any indication that sparc is another exception.cb88 wrote:I get the impression that people don't like gnu as syntax
Re: Sparc kernel help needed
ARM is another exception.For most other architectures, gas' syntax is pretty close to the syntax shown in the architecture/processor manual and the problem does not arise, and I haven't seen any indication that sparc is another exception.
Re: Sparc kernel help needed
I see so it really just isn't that big a deal for Sparc but for the Arm and x86 examples it is rather different hmm.
Re: Sparc kernel help needed
About the serial chip... actually the sun4m and sun4c seem to uses the Zilog 8530 ... as do the earlier Sun Ultras. I acutally only have 1 the U10 which doesn't use the Zilog 8530 .... I imagine that qemu also uses it as it emulates the sparcstation 5.
The netbsd driver is called zs. Also the zilog datasheets http://zilog.com/index.php?option=com_doc&Itemid=99
Found a mailing list post too that tells a bit about the hardware. http://lkml.indiana.edu/hypermail/linux ... /0297.html
Edit also this Alan Cox on the Z3530 probably x86 but still should be helpful:
http://kernelbook.sourceforge.net/z8530book.pdf
The netbsd driver is called zs. Also the zilog datasheets http://zilog.com/index.php?option=com_doc&Itemid=99
Found a mailing list post too that tells a bit about the hardware. http://lkml.indiana.edu/hypermail/linux ... /0297.html
Edit also this Alan Cox on the Z3530 probably x86 but still should be helpful:
http://kernelbook.sourceforge.net/z8530book.pdf
Re: Sparc kernel help needed
openbios-sparc32 built from r1044 with crosstool-ng ... I had to rename some of the compiler binaries from sparc-unkown-elf-* to spar-elf-* to get it to detect the compiler when building the prom
http://webpages.uncc.edu/~carayfie/open ... -r1044.bz2
drop it in your qemu bios path or put it whereever and set the path with qemu-system-sparc -L /some/path
for example qemu-system-sparc -L . assuming the prom is in your working directory.
http://webpages.uncc.edu/~carayfie/open ... -r1044.bz2
drop it in your qemu bios path or put it whereever and set the path with qemu-system-sparc -L /some/path
for example qemu-system-sparc -L . assuming the prom is in your working directory.