loading the kernal.bin file

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
vishal
Posts: 17
Joined: Sun Nov 11, 2007 3:30 pm

loading the kernal.bin file

Post by vishal »

i have been reading the tutorial : http://www.osdever.net/bkerndev/index.php by Mr Brandon F.

in this tutorial when we link all the files we get a kernel.bin file. how do we boot our computer from this binary file??

He does mention in the tutorial: "GRUB needs to be directed to a protected mode binary image: this 'image' is our kernel, which we will be building. "

can sumone tell me how can we boot our computer using kernel.bin with GRUB? can it be done without GRUB too?
User avatar
JackScott
Member
Member
Posts: 1036
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Mastodon: https://aus.social/@jackscottau
Matrix: @JackScottAU:matrix.org
GitHub: https://github.com/JackScottAU
Contact:

Post by JackScott »

There's an image provided by Brandon in his tutorial that contains an installation of GRUB on a FAT12 floppy. I suggest you download this file, write it to a floppy disk using Rawrite or similar, and copy the kernel.bin you created to the root directory of this floppy. If you then reboot your computer, it should boot the kernel.

Edit: No, the code provided by Brandon won't boot without GRUB. If you wanted it to, you'd need to write some 16-bit real mode to 32-bit protected mode changing code. It's better just to use GRUB (IMHO, at least).
vishal
Posts: 17
Joined: Sun Nov 11, 2007 3:30 pm

Post by vishal »

it worked grt...thnks a lot

i have grub installed on my system. can i use it somehow to load this kernel.bin file?? m really scared to experiment on my system....but the GRUB which loads the windows and linux, can it be used to load the kernel.bin file which we have generated after reading the tutorial??

i have gone through sum basic bootloaders....but never through one which loads a binary file!!! can u point me out to a resource where i find the tutorial on the same so dat i can make my oen bootloader to load te kernel.bin file???
User avatar
Combuster
Member
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:

Post by Combuster »

"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
vishal
Posts: 17
Joined: Sun Nov 11, 2007 3:30 pm

Post by vishal »

m sry if i offended u...but as i told i am scared with experimenting with GRUB...i did find the manual before but i wasnt sure abt it as it wud shut my system down ....dats why, i did ask!!!!
User avatar
Combuster
Member
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:

Post by Combuster »

m sry if i offended u
I'm not offended. Just plain annoyed that you ignored the "Read me" link and "posting rules" thread even after being pointed at it
i wasnt sure abt it as it wud shut my system down
that was *not* what you asked.

back to the link (I really urge you to read it thoroughly as well as the other 90% of that document):
More generally, if you write like a semi-literate boob you will very likely be ignored. So don't use instant-messaging shortcuts. Spelling "you" as "u" makes you look like an semi-literate boob to save two entire keystrokes. Worse: writing like a l33t script kiddie hax0r is the absolute kiss of death and guarantees you will receive nothing but stony silence (or, at best, a heaping helping of scorn and sarcasm) in return.

(...)

Often, people who need technical help have a high-level goal in mind and get stuck on what they think is one particular path towards the goal. They come for help with the step, but don't realize that the path is wrong. It can take substantial effort to get past this.

Stupid:
How do I get the color-picker on the FooDraw program to take a hexadecimal RGB value?

Smart:
I'm trying to replace the color table on an image with values of my choosing. Right now the only way I can see to do this is by editing each table slot, but I can't get FooDraw's color picker to take a hexadecimal RGB value.
--------------------------

So far the rant, now to your 'problem':

It will more likely reboot, but I guess that's not your real question either...

Grub loads all its file from disk, and so does windows/linux. If you want to mess up any existing OS you must change those things that
1) affect them
2) persist even when you disconnect power
Unless you blow up your hardware (which is very unlikely) that means that you must have made changes to the hard disk.

Since starting a write to disk is harly anything that happens by accident, it simply means that when you do not include any code that accesses the hard disk, your existing setup will be pretty much safe. The only fried setups I ever had was because of a broken windows installler without me noticing the error in time (128G will always be enough? :wink:)

The tutorial does not really create a 'flat' binary, but instead a multiboot image. GRUB is one of the bootloaders capable of booting such images. There are more, but they're non-standard and even self-written bootloaders are more abundant. If you want to go all the way, you can drop the multiboot format and write your own bootloader, or even a mixture of both. The wiki has the so-called babystep tutorial that deals with bootloaders.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Post by iammisc »

Scared about grub? You really can't screw up a grub installation by changing the grub configuration file. At max grub will spit out an error that it can't read the file and then redirect you to a command line prompt.

You can then use the cat command to read the configuration file and type in the commands to boot linux or windows yourself.
Post Reply