Kernel Loading :(

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
Unexpected

Kernel Loading :(

Post by Unexpected »

I am begginer in OS development.
I don't understand how can I load my kernel?
I have compiled kernel.bin file....
What I need to write in to MBR or somewhere else, to load my kernel.bin into memory?

I know this is stupid question, but can you help me?
Tom

Re:Kernel Loading :(

Post by Tom »

If your using linux to compile & link...look at my web site, install.sh should help you.

Download Prekernel0-6.zip

www.sourceforge.net/projects/fritzos
Unexpected

Re:Kernel Loading :(

Post by Unexpected »

Very thnx :D Your sources is very understandable.
One question. The boot.bin file must be wrote into sector 0, and kernel32.bin file must be loaded into sector 1? Or somewhere else?
Tom

Re:Kernel Loading :(

Post by Tom »

well, right now my kernel32.bin file has to be in sector 1, but the kernel is now probly big enough that it is in sector 1, and 2 and so on.

if you use install.sh in Linux ( open up the INSTALLING file ). type:

sh install.sh with a blank floppy in /dev/fd0 !!!!
( also if you modify my kernel it %100 needs the asm( "jump start" );

Hope that helps you,
Unexpected

Re:Kernel Loading :(

Post by Unexpected »

I compiling your kernel with DJGPP in Win. I am runing the bat file:
nasm -f bin boot.asm -o boot.bin
gcc -c kernel32.c -o kernel32.o
ld -Ttext=0x1000 -o kernel32 kernel32.o -e 0x0
objcopy -R .note -R .comment -S -O binary kernel32.o kernel32.bin

And havening this ld.exe error:
kernel32.o(.text+0x1):kernel32.c: undefined reference to `start'

Whats the problem?
Tom

Re:Kernel Loading :(

Post by Tom »

in the first asm funciton in the C file try

asm( "jmp _start" );
Post Reply