Page 1 of 1
Starting an OS
Posted: Tue May 15, 2007 2:44 pm
by bknitram
I have been reading this place and osdever.net for some time, trying to understand things about OS development. I know that tutorials really don't help me, I have to research the stuff to know it (and feel like its mine).
I have attempted to start many times, but always end up with the same problem: "Not being able to determine what i is a few days later because I copied it directly
out of the tutorial (and read the supplied instructions, but never remember them)"
What steps steps should I take and in which order?
BTW, I know asm and C and understand pointers. So don't tell me that the first thing to do would be to learn asm and C.
Posted: Tue May 15, 2007 3:02 pm
by mathematician
So that you can understand what's going on during the boot process, read up on the BIOS interrupts, find out which pieces of hardware are attached to which ports.
If you are unfamiliar with acronyms such as PIC, PIT, RTC, and so on, find out what they mean (and why the PIC would need your attention during the boot process).
BTW there is an easy way of entering protected mode, reprogramming the PIC and enabling the A20 line, which I seldom see mentioned. And that is to use int 15h, ah=89h (making sure the interrupt flag is cleared before you call that interrupt). When it returns you are in protected mode, and only need to make the usual far jump to reload the cs register.
Posted: Wed May 16, 2007 6:10 pm
by bknitram
Ok.
Also, I'm thinking about a multiboot kernel. So how would I create a disk image (to emulate in qemu or bochs) that has grub on it. I've never been quite able to figure that out.
Posted: Wed May 16, 2007 6:44 pm
by Brynet-Inc
bknitram wrote:Ok.
Also, I'm thinking about a multiboot kernel. So how would I create a disk image (to emulate in qemu or bochs) that has grub on it. I've never been quite able to figure that out.
You could mount the disk image as a loopback device on Linux, or a (s)vnd device under NetBSD/OpenBSD.
That way the image will be just like a normal hardrive, You can install grub..mount it.. copy the correct files.
It's also possible just to install grub "inside" of qemu or bochs and then just mounting under your host operating system.
Posted: Wed May 16, 2007 7:51 pm
by Alboin
Brynet-Inc wrote:It's also possible just to install grub "inside" of qemu or bochs and then just mounting under your host operating system.
Could you explain? I'm curious as to what you mean, exactly...
Posted: Wed May 16, 2007 8:33 pm
by Brynet-Inc
Alboin wrote:Brynet-Inc wrote:It's also possible just to install grub "inside" of qemu or bochs and then just mounting under your host operating system.
Could you explain? I'm curious as to what you mean, exactly...
You can use bochs or qemu to install grub on a virtual disk image right?
Booting a live cd and installing like described here?
http://www.gnu.org/software/grub/manual ... ively.html
Posted: Wed May 16, 2007 8:41 pm
by Alboin
Brynet-Inc wrote:Alboin wrote:Brynet-Inc wrote:It's also possible just to install grub "inside" of qemu or bochs and then just mounting under your host operating system.
Could you explain? I'm curious as to what you mean, exactly...
You can use bochs or qemu to install grub on a virtual disk image right?
Booting a live cd and installing like described here?
http://www.gnu.org/software/grub/manual ... ively.html
Oh...I understand now...I thought you were saying that you could have QEMU automatically start GRUB up at boot and then automatically load your image, or something. I got pretty excited, thinking I didn't have to play with disk images, but all for naught.
Posted: Wed May 16, 2007 8:52 pm
by bknitram
Alboin wrote:Brynet-Inc wrote:Alboin wrote:
Could you explain? I'm curious as to what you mean, exactly...
You can use bochs or qemu to install grub on a virtual disk image right?
Booting a live cd and installing like described here?
http://www.gnu.org/software/grub/manual ... ively.html
Oh...I understand now...I thought you were saying that you could have QEMU automatically start GRUB up at boot and then automatically load your image, or something. I got pretty excited, thinking I didn't have to play with disk images, but all for naught.
Well, I know qemu can load linux kernel images (-kernel and -append and -initrd), though it still requires a disk image.
It doesn't work as nicely loading any multiboot kernel though...
Posted: Thu May 17, 2007 11:09 am
by madeofstaples
I found
this to be a great help
I don't know why the actual link seems to be dead, it's very useful information
Posted: Thu May 17, 2007 11:26 am
by Brynet-Inc
madeofstaples wrote:I found
this to be a great help
I don't know why the actual link seems to be dead, it's very useful information
That page has already been migrated to the OSDev wiki "madeofstaples"..
Use this instead of the old osfaq pages
http://www.osdev.org/wiki/Loopback_Device
Posted: Thu May 17, 2007 12:03 pm
by madeofstaples
Brynet-Inc wrote:madeofstaples wrote:I found
this to be a great help
I don't know why the actual link seems to be dead, it's very useful information
That page has already been migrated to the OSDev wiki "madeofstaples"..
Use this instead of the old osfaq pages
http://www.osdev.org/wiki/Loopback_Device
It turned up in a google search, the OSDev wiki's page didn't, that sounded like kinda a rude tone... I mean geeze, I'm just trying to help the guy, I did point him to valid information did I not?
Posted: Thu May 17, 2007 1:00 pm
by Brynet-Inc
madeofstaples wrote:It turned up in a google search, the OSDev wiki's page didn't, that sounded like kinda a rude tone... I mean geeze, I'm just trying to help the guy, I did point him to valid information did I not?
The OSDev wiki is recommended vs. the older faq pages..
And yes, There was a "rude tone"
do you have a problem with that?
Posted: Thu May 17, 2007 1:20 pm
by madeofstaples
Brynet-Inc wrote:And yes, There was a "rude tone"
do you have a problem with that?
only that it was uncalled for