Basic Compile Troubles

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
Guest

Basic Compile Troubles

Post 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?
Guest

Wrong Link

Post 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?
Guest

Wrong Link

Post 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?
J. Weeks

RE:Wrong Link

Post 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
Post Reply