Page 2 of 2

Posted: Sat Jul 21, 2007 9:56 am
by inflater
Hi,
Try this:

Code: Select all

jmp far 0x0000:0x7C00
-or-

Code: Select all

xor ax,ax
mov ds,ax
jmp far [ds:7C00h]
-or-

Code: Select all

cli
xor ax,ax
mov bx,7C00h
push ax
push bx
sti
retf
I wonder why that INT 19h is not working for you, as borrowed from Ralph Brown's interrupt list, it should work.
I will test it in my OS and I'll post my results.

//EDIT: Your right my man, INT 19h is not working with that...

Regards,
inflater

Posted: Sat Jul 21, 2007 9:04 pm
by fbelzile
The first code didn't compile.
The second code compiled but didn't work.
The third code WORKED like a charm!

Thank-you:

XCHG figured out I had CX as 0000.
Urxae posted the original code that I edited and used.
Inflater mentioned int 19 and solved my jumping problem :lol:

Thanks again, I learned lots! Have a great day 8)

Posted: Sun Jul 22, 2007 1:45 am
by Combuster
Some notes:
inflater wrote:jmp far 0x0000:0x7C00
I use

Code: Select all

jmp 0x0000:0x7C00
(i.e. without the far) which assembles correctly.

Code: Select all

xor ax,ax
mov ds,ax
jmp far [ds:7C00h]
this is obviously wrong. Note the memory operand - it will try to load the offset from memory at 0x0:0x7c00 not jump to 0x0:0x7c00

Code: Select all

cli
xor ax,ax
mov bx,7C00h
push ax
push bx
sti
retf
I don't think the cli/sti pair is necessary here. There is no inconsistent hardware state anywhere in that block so...

Posted: Sun Jul 22, 2007 2:45 am
by inflater
Combuster wrote:I don't think the cli/sti pair is necessary here. There is no inconsistent hardware state anywhere in that block so...
I was setting up segment registers and stack there :), fbelzile, if you do this in your kernel, you can safely strip off CLI and STI parts. :)

inflater