I've had a go at running this through the debugger in qemu.
As far as I can tell, it's working fine. Your kernel.bin loads at 0:7c00, then starts running. It doesn't do very much, then it hits 0x7c31 which is a jump instruction to the same location.
Is that not what it's supposed to do?
Mark
Using bochs
Well, since in main(), there is a call to 'puts("Hello World");' then it should print out "Hello World", because in the assembly file, there is a call to 'main'.
Here is the code that I have. It should be working, because, just to get something up and running, I basically copied it all from a tutorial I'm working from: Bran's Kernel Development Tutorial. The code is everything up to and including "Printing to the screen."
Here is the code that I have. It should be working, because, just to get something up and running, I basically copied it all from a tutorial I'm working from: Bran's Kernel Development Tutorial. The code is everything up to and including "Printing to the screen."
I think it's trying to run 32-bit code in 16-bit mode.
Syslinux does NOT put normally put the CPU into pmode, or set up anything very much for you. This is because it's designed to boot Linux, and Linux contains that setup code itself. Syslinux just loads the image into (DOS) memory and jump to the (DOS) start address 0:7c00 - but that's all.
The CPU is in the wrong mode.
I have however found a solution!
see This page for a description of Syslinux "c32" COMBOOT32 format.
In this format, the kernel is loaded at 0x101000 with a flat memory model. This is what you want, except your link file is telling it to start at 0x100000.
I changed the filename of your kernel to kernel.c32, changed the linker offset to 0x101000 and it worked!
Hello, World :)
Mark
Syslinux does NOT put normally put the CPU into pmode, or set up anything very much for you. This is because it's designed to boot Linux, and Linux contains that setup code itself. Syslinux just loads the image into (DOS) memory and jump to the (DOS) start address 0:7c00 - but that's all.
The CPU is in the wrong mode.
I have however found a solution!
see This page for a description of Syslinux "c32" COMBOOT32 format.
In this format, the kernel is loaded at 0x101000 with a flat memory model. This is what you want, except your link file is telling it to start at 0x100000.
I changed the filename of your kernel to kernel.c32, changed the linker offset to 0x101000 and it worked!
Hello, World :)
Mark
Mark, I don't want to scare you, but you have just become my new best friend!!
Thanks very much Mark, you've just jump started me again. :D
Thanks very much Mark, you've just jump started me again. :D
hi,
i followed your instructions to make the image, but when i start bochs i just get
but my kernel does not start
i used the same tutorial as Endar, though i expanded on it a little
i followed your instructions to make the image, but when i start bochs i just get
Quote:Booting from Floppy...
SYSLINUX 1.75 2002-06-14 Copyright (C) 1994-2002 H. Peter Anvin
.
but my kernel does not start
i used the same tutorial as Endar, though i expanded on it a little
:D I expanded on it as well, the first time.
Then it crashed, and I decided to take it step by step. First you should get something working, then impove it.
Then it crashed, and I decided to take it step by step. First you should get something working, then impove it.
it does work, just not with bochs. if i boot it normally with the computer it works fine, but it doesn't start with bochs
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement