RamonetB's thread got me wondering how exactly the system boots. I found this informative site.
As a result, I have some questions.
I used debug to find this:
FFFF:0000 EA5BE000F0 JMP F000:E05B
and subsequently this:
F000:E05B E91114 JMP F46F
and finally: (commented to the best of my ability)
F000:F46F FA CLI ;clear interrupts
F000:F470 FC CLD ;set loop stuff to count up instead of down? doesn't make sense to me
F000:F471 0F DB 0F ;I didn't think it was valid to have something like this.
F000:F472 01E0 ADD AX,SP ;i assume AX starts at zero
F000:F474 A801 TEST AL,01 ; why not just test sp, 01? would that do the high half (ah) instead?
F000:F476 7408 JZ F480 ;the cpu is happy, do some more booting
F000:F478 FA CLI ;not sure why this is needed again. I see no STI anywhere.
F000:F479 B0FE MOV AL,FE
F000:F47B E664 OUT 64,AL ;reboot, something wasn't good
F000:F47D F4 HLT [/b];everything since the 286 should have rebooted above
what exactly is the test for? make sure that the stack starts off at an address that doesn't end in a 1? I don't understand this. does the stack always have to be an even size? what would it mean if not?
Also, I don't understand the presence of "DB 0F". why is it there? I wrote this:
0AF2:0100 cli
0AF2:0101 cld
0AF2:0102 db 0f
0AF2:0103 mov ax,4c
0AF2:0106 int 21
which gives me an illegal instruction at the DB 0F instruction when I ran it. if I tell windows to ignore the error, the program terminates normally (as expected)
anyway, after that, there is a lot more code. I recognize the test for cold vs. hard boot further on
:
F000:249E 813E72043412 CMP WORD PTR [0472],1234
edit: ooh, i'm a platinum member. and this is my 2^11th post
As a result, I have some questions.
I used debug to find this:
FFFF:0000 EA5BE000F0 JMP F000:E05B
and subsequently this:
F000:E05B E91114 JMP F46F
and finally: (commented to the best of my ability)
F000:F46F FA CLI ;clear interrupts
F000:F470 FC CLD ;set loop stuff to count up instead of down? doesn't make sense to me
F000:F471 0F DB 0F ;I didn't think it was valid to have something like this.
F000:F472 01E0 ADD AX,SP ;i assume AX starts at zero
F000:F474 A801 TEST AL,01 ; why not just test sp, 01? would that do the high half (ah) instead?
F000:F476 7408 JZ F480 ;the cpu is happy, do some more booting
F000:F478 FA CLI ;not sure why this is needed again. I see no STI anywhere.
F000:F479 B0FE MOV AL,FE
F000:F47B E664 OUT 64,AL ;reboot, something wasn't good
F000:F47D F4 HLT [/b];everything since the 286 should have rebooted above
what exactly is the test for? make sure that the stack starts off at an address that doesn't end in a 1? I don't understand this. does the stack always have to be an even size? what would it mean if not?
Also, I don't understand the presence of "DB 0F". why is it there? I wrote this:
0AF2:0100 cli
0AF2:0101 cld
0AF2:0102 db 0f
0AF2:0103 mov ax,4c
0AF2:0106 int 21
which gives me an illegal instruction at the DB 0F instruction when I ran it. if I tell windows to ignore the error, the program terminates normally (as expected)
anyway, after that, there is a lot more code. I recognize the test for cold vs. hard boot further on
F000:249E 813E72043412 CMP WORD PTR [0472],1234
edit: ooh, i'm a platinum member. and this is my 2^11th post