flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Sector loading code

Author
Thread Post new topic Reply to topic
adefeo



Joined: 12 Jan 2004
Posts: 46
Location: Bellmore, Long Island, New York
adefeo
Wow, I haven't posted on this board in ages.

I'm having some trouble with some newly added sector loading code in my OS. It compiles fine, but when you try to load sector 2 on a floppy disk, Bochs panics with the message "00068675875p[CPU0 ] >>PANIC<< prefetch: RIP > CS.limit". Some links to the code:

Kernel code: http://protonix.asmhackers.net/protonix/v2/build1/devel/NEWPRO.ASM

Program on sector 2 (that i'm trying to load): http://protonix.asmhackers.net/protonix/v2/build1/devel/test.asm

Bochs log: http://protonix.asmhackers.net/protonix/v2/build1/devel/log.txt

Project website:
http://protonix.asmhackers.net

Project forum:
http://protonix.asmhackers.net/board

Thanks,
Anthony
Post 22 May 2005, 13:47
View user's profile Send private message Visit poster's website AIM Address Reply with quote
deltre



Joined: 17 Apr 2005
Posts: 12
Location: Netherlands
deltre
Hi,

I didn't check your code yet, and I don't use bochs, but from the log:

read() returned 0
RIP > CS.limit

The read() returned 0, this indicated success? I think bochs might keep track of CS:IP in one variable, and calls it RIP (Real Instruction Pointer?). From my point of view it looks like somehow this RIP exceeds any address addressable with the CS segment.

You could try the following options to see if it helps:
- output some text after a successfull read, but before the jump, to see where the error is
- debug your code to see if the jmp far turns out the way you planned it
- reset the file system before each read retry (the way it's documented Razz)

Good luck!
Post 23 May 2005, 08:42
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
adefeo



Joined: 12 Jan 2004
Posts: 46
Location: Bellmore, Long Island, New York
adefeo
OK, the sector loads fine, so it's either the jump or the code that I'm jumping to.
Post 23 May 2005, 21:31
View user's profile Send private message Visit poster's website AIM Address Reply with quote
bubach



Joined: 17 Sep 2004
Posts: 340
Location: Trollhättan, Sweden
bubach
Oh, I thought that it meant "rest in peace CS limit.." Very Happy
Post 24 May 2005, 08:31
View user's profile Send private message Reply with quote
deltre



Joined: 17 Apr 2005
Posts: 12
Location: Netherlands
deltre
I used to use another assembler, which couldn't handle

Code:
jmp far 0x2000:0x0000    


Instead, you had to

Code:
db      0EAh
dw      destinationOffset, destinationSegment   
    


Thats why I brought up the "debug to see if the jmp was assembled correctly". Code looks fine to me, after a successfull read there cannot be any operation but the jmp.
Post 24 May 2005, 08:41
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 559
smiddy
I am assuming that RIP is a part of AMD64 (for my own edification)?

I use two pushes and RETF to jump to the offending code that I've loaded from my boot sector:

Code:
   PUSH WORD 0x0000          ; Push the Offset onto the stack
   PUSH WORD 0x2000          ; Push the new CS onto the stack

   RETF
    


I may have these reveresed and backwards (depending on your ORG for your code to load).
Post 24 May 2005, 11:47
View user's profile Send private message Reply with quote
deltre



Joined: 17 Apr 2005
Posts: 12
Location: Netherlands
deltre
Awwight what version of bochs do you use? I've searched for your error message a bit, found a changelog for bochs 2.1 that says:

Quote:
- these S.F. bugs were closed
#685508 PANIC: prefetch: RIP > CS.limit
Post 24 May 2005, 12:51
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 559
smiddy
deltre:

It looks like 2.2 Pre 3:

Code:
00000000000i[ ] Bochs x86 Emulator 2.2.pre3
    
Post 24 May 2005, 14:21
View user's profile Send private message Reply with quote
adefeo



Joined: 12 Jan 2004
Posts: 46
Location: Bellmore, Long Island, New York
adefeo
Thanks. I'll try those things when I get home.
Post 24 May 2005, 20:09
View user's profile Send private message Visit poster's website AIM Address Reply with quote
adefeo



Joined: 12 Jan 2004
Posts: 46
Location: Bellmore, Long Island, New York
adefeo
None of the alternate "jumping" methods worked. Any ideas?
Post 24 May 2005, 21:26
View user's profile Send private message Visit poster's website AIM Address Reply with quote
adefeo



Joined: 12 Jan 2004
Posts: 46
Location: Bellmore, Long Island, New York
adefeo
Well, I've finally gotten everything sorted out. Turns out that iwas just a problem with the int 0x13 options. So, the OS was loading the sectors and jumping OK, just to the wrong sector.

Anyway, it's all fixed now, and I released version 512DevOS 0.02 (formerly Protonix and BS/OS) with sector loading support at 12:07AM EDT this morning. Don't ask why I did a midnight release; I just figured out the problem (with help from Benjamin David Lunt) that late.

So grab a copy at http://512dev.us.tt
Be sure to join our forums, no new members/activity in a while...

I like to code assembler by moonlight. lol j/k
Post 11 Jun 2005, 12:59
View user's profile Send private message Visit poster's website AIM Address Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.