Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / OS Dev - Booting my Kernel

Author
Message
Jeff032
17
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 15th May 2008 04:53 Edited at: 15th May 2008 07:25
So I've been following a tutorial on how to create a very basic operating system, I've been able to understand it rather well, and I've created a kernel that should print some stuff to the screen.

But now the tutorial says to copy the kernel to my GRUB floppy, and that lost me, because it hasn't covered anything about this.

Now I don't have a floppy disk, let alone a floppy drive to shove it in, so I was planning on using Bochs as an emulator. Bochs has a Disk Image Creation Tool, which basically gives me a 1.44 MB file filled with 0x00.

I need to know how to get my kernel onto that floppy disk image so that Bochs can "boot" from it. Google hasn't turned up anything useful. I'm using Windows XP Professional, with DJGPP and NASM, if that matters.

Thanks,
Jeff

Osiris
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: Robbinsdale, MN
Posted: 15th May 2008 04:56
Hmm, well GRUB is a booter, download GRUB and see if you can burn it to a CD instead.

RIP Max-Tuesday, November 2 2007
You will be dearly missed.
Jeff032
17
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 15th May 2008 07:05
Ok, after a lot of thinking and reading and rebooting, I think I've managed to get GRUB working on a CDROM. When it loads my kernel, it prints ", bss=0x3010" and then the "Starting Loading..." or whatever, and then doesn't really do anything.

I'm going to give the example kernel a try and see if that works. If it does, it's a problem with mine.

Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 15th May 2008 07:10
If you're serious about this then you should just buy a USB floppy drive. I'm sure it can't be more than $20 or so.


Osiris
20
Years of Service
User Offline
Joined: 6th Aug 2004
Location: Robbinsdale, MN
Posted: 15th May 2008 07:42
Quote: "If you're serious about this then you should just buy a USB floppy drive. I'm sure it can't be more than $20 or so."


Pfft. USB is so 2001. Use bluetooth and black magic.

RIP Max-Tuesday, November 2 2007
You will be dearly missed.
Jeff032
17
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 15th May 2008 07:58
I'm not sure I'm that serious about it right now. I'm just experimenting for starters.

I managed to get it working though. And I'm using Bochs with the iso file so I don't need to reboot all the time.

Thanks for the help

Dextro
19
Years of Service
User Offline
Joined: 26th Feb 2005
Location:
Posted: 15th May 2008 08:20 Edited at: 15th May 2008 09:21
Would you be so kind to post the link to the tutorial?
I have some ASM knowledge, and this sounds kinda fun.
Kohaku
20
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 15th May 2008 12:57
Dextro beat me to it; a link to this would be rather interesting!


You are not alone.
SunnyKatt
18
Years of Service
User Offline
Joined: 16th Sep 2006
Location: USA
Posted: 15th May 2008 13:09
Get a massive 16 gig flash drive like me.

Jeff032
17
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 15th May 2008 16:36 Edited at: 15th May 2008 18:36
Here you go:
http://osdever.net/bkerndev/Docs/intro.htm

GRUB Manual
http://www.gnu.org/software/grub/manual/grub.html

My Bochs config file is this:
ata0-slave: type=cdrom, path="disk.iso", status=inserted, biosdetect=auto, model="Generic 1234"
boot: cdrom


My menu.lst (for the iso) is this:
(boot is a folder in the iso directory, kernel is the kernel)
default 0
timeout 30
title Test
kernel /boot/kernel
boot /boot/kernel


If anyone knows an equivalent of mkisofs for Windows that can be run completely from the command line, I would like to know, so that I don't have to use VMPlayer + Ubuntu for making the iso.

I'm using a flash drive to send files between XP and my virtual ubuntu machine.

Quote: "Get a massive 16 gig flash drive like me."

I'm doing perfectly fine with my $10 4GB flash drive

[EDIT]
http://cdrecord.berlios.de/old/private/cdrecord.html
That might do it, but I have to go for a while now.

Jeff032
17
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 15th May 2008 20:54
Ok, the version at the link I posted earlier didn't work, but I found a newer version that works perfectly here:

http://smithii.com/files/cdrtools-latest.zip

So now I don't need VMPlayer, and I can just run a couple of batch files to build the kernel, make the iso, and then run the emulator.

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 21st May 2008 16:48
Interesting thread. I wrote a couple home rollwed boot straps and an OS... never off cdrom or usb .. but... the boot strap "hello world" isn't the tricky part... its writing a loader that chunks code and data directly into memory - (the actual loader usually) yeah.. little loader loads the real loader - .. and then entering protected mode. This all needs to planned as with intel at least, there are various OS memory models you can use, and you need to look into Task Segment registers and other stuff like it to get the various protection levels going and multi-threading going correctly. This - is the real kernal.

Good luck. Its a lot of fun but VERY challenging and slow going.

Login to post a reply

Server time is: 2024-11-20 06:31:00
Your offset time is: 2024-11-20 06:31:00