Starting an OS

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
bknitram
Posts: 3
Joined: Sat Apr 07, 2007 12:37 pm

Starting an OS

Post 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. :wink:
User avatar
mathematician
Member
Member
Posts: 437
Joined: Fri Dec 15, 2006 5:26 pm
Location: Church Stretton Uk

Post 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.
bknitram
Posts: 3
Joined: Sat Apr 07, 2007 12:37 pm

Post 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.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post 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.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post 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...
C8H10N4O2 | #446691 | Trust the nodes.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post 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
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post 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.
C8H10N4O2 | #446691 | Trust the nodes.
bknitram
Posts: 3
Joined: Sat Apr 07, 2007 12:37 pm

Post 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...
madeofstaples
Member
Member
Posts: 204
Joined: Thu Apr 12, 2007 8:15 am
Location: Michigan

Post 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
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post 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 :roll:
http://www.osdev.org/wiki/Loopback_Device
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
madeofstaples
Member
Member
Posts: 204
Joined: Thu Apr 12, 2007 8:15 am
Location: Michigan

Post 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 :roll:
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?
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post 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" :wink: do you have a problem with that?
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
madeofstaples
Member
Member
Posts: 204
Joined: Thu Apr 12, 2007 8:15 am
Location: Michigan

Post by madeofstaples »

Brynet-Inc wrote:And yes, There was a "rude tone" :wink: do you have a problem with that?
only that it was uncalled for
Post Reply