starting up a test os :(

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
Brill

starting up a test os :(

Post by Brill »

Hi, i have some code written in asm and c++
compiled and linked, ready to go, saved on a
bootable floppy disk and loaded with grub.
But when grub tries to load the file
it juest repeats itself.
Failing to load it trying over and over since the
timeout is zero.
I tried it with lilo too, just as a check and the
same again.
Any idea on what's not going right?
The code used is actually code of the net im
trying to test out switching to pmode (im still
learning like that) so its not mine but it looks
cosure and im assuming it should work.
The Legend

RE:starting up a test os :(

Post by The Legend »

>On 2002-04-03 14:13:35, Brill wrote:
>Hi, i have some code written in asm and c++
>compiled and linked, ready to go, saved on a
>bootable floppy disk and loaded with grub.
>But when grub tries to load the file
>it juest repeats itself.
>Failing to load it trying over and over since the
>timeout is zero.
>I tried it with lilo too, just as a check and the
>same again.
>Any idea on what's not going right?
>The code used is actually code of the net im
>trying to test out switching to pmode (im still
>learning like that) so its not mine but it looks
>cosure and im assuming it should work.
Are you sure that the code works and is not
triple-faulting?

The Legend
Brill

RE:starting up a test os :(

Post by Brill »

>On 2002-04-04 02:49:00, The Legend wrote:
>>On 2002-04-03 14:13:35, Brill wrote:
>>Hi, i have some code written in asm and c++
>>compiled and linked, ready to go, saved on a
>>bootable floppy disk and loaded with grub.
>>But when grub tries to load the file
>>it juest repeats itself.
>>Failing to load it trying over and over since the
>>timeout is zero.
>>I tried it with lilo too, just as a check and the
>>same again.
>>Any idea on what's not going right?
>>The code used is actually code of the net im
>>trying to test out switching to pmode (im still
>>learning like that) so its not mine but it looks
>>cosure and im assuming it should work.
>Are you sure that the code works and is not
>triple-faulting?
>
>The Legend


ok, i can't be sure the code actually works.
Plus i'll be honest, the code was originally written
in C but the c compiler complained about some function
called movedata.
I don't know C so i changed it a little around to
be C++. Here's what happens. The asm sets up pmode.
Then calls the C++ code. The c++ then copies some
stuff to VGA video memory for display.
Thats it.
If the code doesn't work correctly and is tripple
faulting the cpu then shouldn't the whole machine
restart?
Instead of the bootloader trying to load over and
over?
Im fairly sure that my code's ok. It was in another
os example and from sigops.
Plus, i tried that sigops code example hello world os
and it doesn't work. Guessing that code happens to be
pmode 32 bit and the pmode doesn't change.
Does anyone know if that's what the developer wanted to
happen or is there something i didn't do write?
J. Weeks

RE:starting up a test os :(

Post by J. Weeks »

>ok, i can't be sure the code actually works.
>Plus i'll be honest, the code was originally written
>in C but the c compiler complained about some function
>called movedata.
>I don't know C so i changed it a little around to
>be C++. Here's what happens. The asm sets up pmode.
>Then calls the C++ code. The c++ then copies some
>stuff to VGA video memory for display.
>Thats it.
>If the code doesn't work correctly and is tripple
>faulting the cpu then shouldn't the whole machine
>restart?

Right.

>Instead of the bootloader trying to load over and
>over?

Sounds to me like your bootloader isn't actually
being loaded. None of the code is even being executed
because it can't get loaded in the first place.

Are you sure you wrote the loader to disk
properly? Did you describe the loader properly
to GRUB?

Also, is this bootloader grub compatible? It
doesn't assume it's being loaded at 7c00 like a
boot sector, and load more data itself, does it?

>Plus, i tried that sigops code example hello world os
>and it doesn't work. Guessing that code happens to be
>pmode 32 bit and the pmode doesn't change.
>Does anyone know if that's what the developer wanted to
>happen or is there something i didn't do write?

How did you compile the hello world example?
It needs gmake not make.

Did you try booting it using bootmaker with the
-floppy command.

Jeff
Tim Robinson

RE:starting up a test os :(

Post by Tim Robinson »

>On 2002-04-04 04:03:16, Brill wrote:
>The asm sets up pmode.

That's wrong for a start. GRUB switches to
protected mode before it jumps to your kernel.
All you need to do is set up your own GDT and
stack.

>Im fairly sure that my code's ok. It was in another
>os example and from sigops.
>Plus, i tried that sigops code example hello world os
>and it doesn't work. Guessing that code happens to be
>pmode 32 bit and the pmode doesn't change.

Sigops used their own boot loader which won't be
compatible with GRUB. Try the Sigops code with
their boot loader to make sure it does work, then
try to make it work with GRUB.
Post Reply