Page 1 of 1

VFS error

Posted: Mon Nov 08, 2010 3:16 pm
by Mezo
Hi everyone,
At first I want to say that is a great tutorial.
Now i have downloaded the VFS tutorial (Chapter 22).
When i run it in an emulator such as MSVPC or Bochs it runs perfectly but when i run it on real computer it doesn't running and the error handler starts and tells me "*** STOP:General Protection Fault"
I don't know where is the problem.
I have tried it on two computer and it always shows the same error.
I didn't change any small part from the code

and i have searched in the forums about the error and i have found this post :
http://www.brokenthorn.com/forums/viewt ... &view=next

and i have downloaded this demo :
http://brokenthorn.com/Resources/Demos/SysCore2.zip

this demo runs in a real computer but when i start to read a text file it stops without any error.

Can anyone help me in my situation ?
------------------------------------------------
Thank you in advance.
And specially thank you MR.Mike

Re: VFS error

Posted: Mon Nov 08, 2010 10:43 pm
by Andyhhp
Sorry but you are going to have to provide more information than just that.

First of all, what processors are in the real computers you tried?

Re: VFS error

Posted: Tue Nov 09, 2010 6:56 am
by Mezo
Hi,
It's a P4M900-M4 mother board.
http://www.biostar.com.tw/app/en/mb/con ... p?S_ID=283
With processor Intel Pentium 4 3.00 GHz
and it have 1.5 GB RAM DDR2

Re: VFS error

Posted: Wed Nov 10, 2010 11:51 am
by chibicitiberiu
Please note that the floppy driver that is used in this series is bugged, it has several problems. You can check it for yourself, find the bugs, and fix them, and use as reference this article: http://wiki.osdev.org/Floppy_Disk_Controller

I found personally some nasty bugs, you should check it. It may run okay in emulators, but it doesn't compare to real computers.

Re: VFS error

Posted: Mon Nov 15, 2010 12:01 am
by halofreak1990
chibicitiberiu wrote:Please note that the floppy driver that is used in this series is bugged, it has several problems. You can check it for yourself, find the bugs, and fix them, and use as reference this article: http://wiki.osdev.org/Floppy_Disk_Controller

I found personally some nasty bugs, you should check it. It may run okay in emulators, but it doesn't compare to real computers.
I agree with this. Emulators and real hardware do not work exactly alike, which is why my homebrew kernel does not work in VirtualPC, but runs on real hardware just fine.

The key to getting something useful from the floppy drive on real hardware, is to retry every command sent to the floppy drive.
Especially the calibrate command, since it often takes 2 tries to get it to sector0.
Retry and check the return values to see if things work.

My Floppy code is over 3x bigger than Mike's, because of error checking and retrying if it fails, though the code is designed to give up after roughly 10 tries, since the hardware is most likely faulty if it takes that much.

Re: VFS error

Posted: Mon Nov 15, 2010 5:21 am
by Mike
Hello,

There is a couple of issues with the demo provided by the FDC chapter. An update is planned with these fixes, however there might be a restructure of this part of the series.

More specifically, the DMA chapter might be moved before the FDC chapter to avoid the current issues with the DMAC interface in the current FDC chapter. If anyone has any comments on this possible change, please post them here.