problem loading files from floppy

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
User avatar
gzaloprgm
Member
Member
Posts: 141
Joined: Sun Sep 23, 2007 4:53 pm
Location: Buenos Aires, Argentina
Contact:

problem loading files from floppy

Post by gzaloprgm »

Hello, I'm having problems while using the 2 stage bootloader from http://www.brokenthorn.com/Resources/Demos/Demo4.zip

The problem is that it works perfectly on bochs, qemu and my new pc, but when I try it on my old pc, it just reboot after jumping to the kernel.

I'm sure the processor executed garbage instructions and made a triple fault and didn't load the 3rd stage.

The second stage gets loaded perfectly. In it I install the gdt, enable a20 line, load root directory table from floppy, load kernel in memory, using bios interruptions, and then I switch to pmode and jump to my kernel.

By the way, these are the specifications:
Processor: Pentium MMX 233mhz
Ram: 64MiB
Bios: Award Modular Bios PCI/PNP 586 4.51PG
Floppy Drive: NEC FD1231H
Chipset: 08/14/97-vXPro+-USB-Ultr-2A5ldh09c-00

If anyone had experienced this error, I'd like to know how you solved it.

Thanks,
Gonzalo
Last edited by gzaloprgm on Mon Jan 21, 2008 8:56 pm, edited 2 times in total.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

The link is dead. :(

Are you sure you don't use processor features that aren't available, or some other incorrect assumption? Try manually compiling a bochs version that pretends to be a 386 or 486 and see if the problem appears there as well.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Post by neon »

Linky

This is a *.zip file.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
gzaloprgm
Member
Member
Posts: 141
Joined: Sun Sep 23, 2007 4:53 pm
Location: Buenos Aires, Argentina
Contact:

Post by gzaloprgm »

Combuster wrote:The link is dead. :(

Are you sure you don't use processor features that aren't available, or some other incorrect assumption? Try manually compiling a bochs version that pretends to be a 386 or 486 and see if the problem appears there as well.
Thanks combuster but it's not that problem.

I'm using a Pentium MMX so I guess the problem is from the bios/chipset rather than an invalid instruction.

Now I fixed the link.

The second stage sets the stack, installs the gdt, enables a20 gate using keyboard controller, loads the root directory table from a floppy using bios interruptions, then it looks for the kernel file and loads it in memory, and then it goes to pmode, set the stack and jumpes into the kernel.
Post Reply