Page 1 of 1

Basic Compile Troubles

Posted: Tue Mar 19, 2002 12:00 am
by Guest
First of all, I have a zip file with my test kernel.
Its located at http://208.185.27.162/files/RealModekern.zip

It basically consists of three main files, main.c,
wrapper.s, and kprintf.c

All I want it to do is boot, display a message on the screen,
and then go into an infinite loop.

Here is my problem..
I made the assembly wrapper and assembled it in Nasm using:
nasm -f coff wrapper.s

When I linked 'em, they linked fine (as a .bin file).
However, when I boot, its executes up to the point where it jumps
to the kernel, and then stops, like it doesn't find it.

Can anybody help?

Wrong Link

Posted: Tue Mar 19, 2002 12:00 am
by Guest
Sorry, wrong link
http://www.simulcra.net/Files/RealModekern.zip

>On 2002-03-19 22:44:58, Anonymous wrote:
>First of all, I have a zip file with my test kernel.
>Its located at http://208.185.27.162/files/RealModekern.zip
>
>It basically consists of three main files, main.c,
>wrapper.s, and kprintf.c
>
>All I want it to do is boot, display a message on the screen,
>and then go into an infinite loop.
>
>Here is my problem..
>I made the assembly wrapper and assembled it in Nasm using:
>nasm -f coff wrapper.s
>
>When I linked 'em, they linked fine (as a .bin file).
>However, when I boot, its executes up to the point where it jumps
>to the kernel, and then stops, like it doesn't find it.
>
>Can anybody help?

Wrong Link

Posted: Tue Mar 19, 2002 12:00 am
by Guest
Sorry, wrong link
http://www.simulcra.net/Files/RealModekern.zip

>On 2002-03-19 22:44:58, Anonymous wrote:
>First of all, I have a zip file with my test kernel.
>Its located at http://208.185.27.162/files/RealModekern.zip
>
>It basically consists of three main files, main.c,
>wrapper.s, and kprintf.c
>
>All I want it to do is boot, display a message on the screen,
>and then go into an infinite loop.
>
>Here is my problem..
>I made the assembly wrapper and assembled it in Nasm using:
>nasm -f coff wrapper.s
>
>When I linked 'em, they linked fine (as a .bin file).
>However, when I boot, its executes up to the point where it jumps
>to the kernel, and then stops, like it doesn't find it.
>
>Can anybody help?

RE:Wrong Link

Posted: Wed Mar 20, 2002 12:00 am
by J. Weeks
>On 2002-03-19 23:20:38, Anonymous wrote:
>Sorry, wrong link
>http://www.simulcra.net/Files/RealModekern.zip
>
>>On 2002-03-19 22:44:58, Anonymous wrote:
>>First of all, I have a zip file with my test kernel.
>>Its located at http://208.185.27.162/files/RealModekern.zip
>>
>>It basically consists of three main files, main.c,
>>wrapper.s, and kprintf.c
>>
>>All I want it to do is boot, display a message on the screen,
>>and then go into an infinite loop.
>>
>>Here is my problem..
>>I made the assembly wrapper and assembled it in Nasm using:
>>nasm -f coff wrapper.s
>>
>>When I linked 'em, they linked fine (as a .bin file).
>>However, when I boot, its executes up to the point where it jumps
>>to the kernel, and then stops, like it doesn't find it.
>>
>>Can anybody help?

Hmm... well, I got a CRC error when I extracted
that .zip (tried downloading twice). Seems to
have extracted okay, though.

Anyway, I don't know if any of these will help,
but...

You haven't created a stack, so that call to
kprint might cause a crash.

You're compiling with gcc, which wont produce
real mode code, so any function you call is going
to be called with a 32-bit jump (granted, in
real-mode, the default prefix is 16-bits, so it
will probably work... but other things will be
messed up (you're shorts will be longs, and vise
versa)).

You've given your kernel an offset of 0x00010000,
but you're jumping directly to _main, not
main + 0x00010000

Hopefully one of these helps... I haven't given
it a thorough (sp?) look-through, 'cuz I'm in
school right now, so these are just first
impressions... hopefully it works out.

Jeff