Beginner Q on OS Dev

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
Sysem
Posts: 4
Joined: Tue Feb 28, 2012 1:02 pm

Beginner Q on OS Dev

Post by Sysem »

Ok, first of all, excuse the really inexperienced post. My knowledge here is a little shakey - I work with normal desktop programming and embedded systems (which I guess is similar, but I'm having troubles :mrgreen: )

Anyway, I followed the Bare Bones tutorial, and understand it. Sort of. It works (tested on Qemu and loading the .img file to a usb and booting from that). However, in the tutorial, they use GRUB as a bootloader and I have to manually enter the commands "kernel 200+18" and "boot" when GRUB boots. Now this was great for testing and playing around, but its not very practical.

So basically I'm looking for a way to skip (or automate?) those commands so it goes straight to booting my very simple Hello World kernel. I'd like to stick with GRUB as a bootloader, just because writing one has proved to be more challenging than I'd like to admit.

So whats the best approach on doing this? I searched around and found articles on grub.cfg and menu.lst? But in the Bare Bones tutorial, the only GRUB files used are stage1 and stage2.

Thanks,
Sysem
User avatar
brain
Member
Member
Posts: 234
Joined: Thu Nov 05, 2009 5:04 pm
Location: UK
Contact:

Re: Beginner Q on OS Dev

Post by brain »

Yes you can do this. Google around for the grub 1.97 pre built that you can find in many hobby oses - this will do what you need, but remember to install it onto a proper filesystem image of course, fat32 or iso9660 will do fine.

Mine is here with stage 1_5 for iso9660 cd:

http://brainbox.cc/repository/trunk/six ... boot/grub/
Sysem
Posts: 4
Joined: Tue Feb 28, 2012 1:02 pm

Re: Beginner Q on OS Dev

Post by Sysem »

brain wrote:Yes you can do this. Google around for the grub 1.97 pre built that you can find in many hobby oses - this will do what you need, but remember to install it onto a proper filesystem image of course, fat32 or iso9660 will do fine.

Mine is here with stage 1_5 for iso9660 cd:

http://brainbox.cc/repository/trunk/six ... boot/grub/
Thanks.

Now the 2nd part is installing it to the floppy image? do I just cat those stage1, stage2, menu.lst, iso9660 and my kernel to a new file "floppy.img"?

Sorry, I know this seems trivial but for some reason I'm struggling more with the img creation and not that OS dev part...

Sysem
User avatar
brain
Member
Member
Posts: 234
Joined: Thu Nov 05, 2009 5:04 pm
Location: UK
Contact:

Re: Beginner Q on OS Dev

Post by brain »

Those are for cd Rom iso image - browse around my repository for how to embed this with genisoimage or mkisofs in linux. personally I find floppies very limiting and avoid them...
Sysem
Posts: 4
Joined: Tue Feb 28, 2012 1:02 pm

Re: Beginner Q on OS Dev

Post by Sysem »

brain wrote:Those are for cd Rom iso image - browse around my repository for how to embed this with genisoimage or mkisofs in linux. personally I find floppies very limiting and avoid them...
Ok I made a iso file instead (following these tutorials: http://wiki.osdev.org/Mkisofs and http://wiki.osdev.org/Bootable_CD) and it boots. But instead of booting my kernel or the grub menu, it says:

Booting from DVD/CD...
0MB medium found
GRUB
User avatar
brain
Member
Member
Posts: 234
Joined: Thu Nov 05, 2009 5:04 pm
Location: UK
Contact:

Re: Beginner Q on OS Dev

Post by brain »

Hmm, I never followed any tutorial for it, I just dumped the grub files into /boot/grub, set up the menu.lst and then created a no-emulation el-torito cdrom iso... does that way work for you? Make sure you don't use grub 2.x as its a little more difficult to get working imho.

Edit: those tuts are for emulation mode. this is more what you need: http://wiki.osdev.org/Bootable_El-Torit ... RUB_Legacy
Sysem
Posts: 4
Joined: Tue Feb 28, 2012 1:02 pm

Re: Beginner Q on OS Dev

Post by Sysem »

brain wrote:Hmm, I never followed any tutorial for it, I just dumped the grub files into /boot/grub, set up the menu.lst and then created a no-emulation el-torito cdrom iso... does that way work for you? Make sure you don't use grub 2.x as its a little more difficult to get working imho.

Edit: those tuts are for emulation mode. this is more what you need: http://wiki.osdev.org/Bootable_El-Torit ... RUB_Legacy
You, sir, have made my day! No I can focus more on the development of my kernel! Thanks a million!

=D>

Sysem
Post Reply