So it still 16-Bit? what should I do then? what about Far jump linier address? on olly dbg when I have reach Pmode, EA Opcode will be 7 Bytes . By the way, is it working properly? does the work is that way?
I dont know, about that 16 bit selector, is it realy working? Jmp 0008:C0DE? I think the opcode I have assembled is working ( :confused: , maybe ) it is EA DA C0 DE 00 08 00. How did you set selector/segment? use mov , ?
I dont know, about that 16 bit selector, is it realy working? Jmp 0008:C0DE? I think the opcode I have assembled is working ( :confused: , maybe ) it is EA DA C0 DE 00 08 00. How did you set selector/segment? use mov , ?
its kinda 32bit/16bit mix in pmode. the far jump is already
in the prefetch-queue - 16bit. it will be executed in 16 bit
but we are already in pmode (selectors are used).
you saw what came out when i disassembled your code - this
can't work. you can try the 32bit far jump too:
you can see that in the opcode you have to invert the byte-order of the address!
but i've also noticed that the addresses don't match. your code will be loaded
to 0000:7c00, in all your codes you seem not to think about that (in my samples
also!)
to set the selector registers you have 2 possibilities:
i've just noticed that in the sample where i wrote the gdt for you the gdt-limit
is too less. for 3 selectors the limit has to be 3*8=24. in my code its 20!
in the prefetch-queue - 16bit. it will be executed in 16 bit
but we are already in pmode (selectors are used).
you saw what came out when i disassembled your code - this
can't work. you can try the 32bit far jump too:
:
:
:000001F8 0F01E0 smsw eax
:000001FB 0C01 or al, 01
:000001FD 0F01F0 lmsw eax
:00000200 EA080200000800 jmp 0008:00000208
:00000207 90 nop
:00000208 EBFD jmp 00000207
:
:
you can see that in the opcode you have to invert the byte-order of the address!
but i've also noticed that the addresses don't match. your code will be loaded
to 0000:7c00, in all your codes you seem not to think about that (in my samples
also!)
to set the selector registers you have 2 possibilities:
either:
mov ax,0x0010 ;data-selector
mov ds,ax
or:
push 0x0010
pop ds
i've just noticed that in the sample where i wrote the gdt for you the gdt-limit
is too less. for 3 selectors the limit has to be 3*8=24. in my code its 20!
It rebooted each time I set the selector. Does my selector are invalid?.
Note: I have updated my compiler. You can compile the source, it located on my website. If you have time to use it.
Note: I have updated my compiler. You can compile the source, it located on my website. If you have time to use it.
you saw what came out when i disassembled your code - this
can't work. you can try the 32bit far jump too:
:
:
:000001F8 0F01E0 smsw eax
:000001FB 0C01 or al, 01
:000001FD 0F01F0 lmsw eax
:00000200 EA080200000800 jmp 0008:00000208
:00000207 90 nop
:00000208 EBFD jmp 00000207
:
:
either:
Thank you for guiding me hartyl, This code, is it working? the 32-Bit far jump.
this was one mistake i made when setting myself up to pm. using the 32bit-version the computer just resets. i told you to try it. but on my system it doesn't work.
On my system too. It just restart. Im a bit confused about this. You're right. Im hoping you rewrite my code, thanks for guiding me once again.
late, but... ok. just because it's you i wrote the code. it can be executed from dos and does what you wanted. i hope you can move on, then.
i had also some reset-probs. guess what? i forgot the cli !!!
i had also some reset-probs. guess what? i forgot the cli !!!
Thanks for the Code. I have entered it. Do you know how to read a File while Im on Pmode ?
heh, no. not yet. you'll have to move the head of the fdd by using the ports, hdd access is also done that way - and thats damn difficult. that's what i want to implement in the future - but for now i want to complete the gui.
Im get stuck again. I dont know whats wrong with it. I cannot understand why it wint work, I have enable line A 20 and anything. The Fiirst time I made it are work, but when I modificate it, it rebooted.
oh man :). but this time i immediately found the error (i hope its the only one):
i have just noticed that you just set the base of the first selector, the others keep 0xffff
xor eax,eax
mov ax,cs
[b]shl eax,4 ;you forgot shift for the linear address[/b]
mov si,112
mov [si],ax
inc si
inc si
shr eax,#16
mov [si],al
i have just noticed that you just set the base of the first selector, the others keep 0xffff
xor eax,eax
mov ax,cs
shl eax,4
mov si,112
mov [si],ax
[b]mov [si+8],ax
mov [si+16],ax
mov [si+24],ax[/b]
inc si
inc si
shr eax,#16
mov [si],al
[b]mov [si+8],al
mov [si+16],al
mov [si+24],al[/b]
Thanks, Great. It working now. There is a lot of mistake I made. Here is the new source. About [Si+8) and else, Im still unable to make my compiler able to translated it.
i can just say "fasm ruleZ in such things - go, use it" :)
btw, is your work going to be an os?
btw, is your work going to be an os?
No, Im not planning to build an OS, Im planning to Build a Game. I think it will be great if my Game use Diskette and the whole processing and memory.
I cannot call my own function, can you tell me why? is it because the selector must but use 0x9a attribute? also SS, when I change it, it wont push anything and restarted. Why?:confused:
i still don't get it. you write a game which switches from dos to pm... why don't you write a windows game - you have to whole interface. directX, ogl no probs with stack and the base of the system.
the way you go you have to implement *everything*.
btw... i almost get tired of writing code for you. i can't believe that the code worked you posted the last time.
since you don't set the base of the 2nd selector the system resets the first time you access the data-selector. you set it also to the ss-register. a call pushes eip onto the stack (to return from the function again) - and thats the reason why it resets. actually since the base is just 0x0000FFFF it could be another reason.
the way you go you have to implement *everything*.
btw... i almost get tired of writing code for you. i can't believe that the code worked you posted the last time.
xor eax,eax ; Base are Set here
mov si,11a
mov ax,cs
shl eax,4
mov [si],eax ;you still don't set the base for the 2nd selector!
mov si,011d
mov al,9a
mov [si],al ;<--
since you don't set the base of the 2nd selector the system resets the first time you access the data-selector. you set it also to the ss-register. a call pushes eip onto the stack (to return from the function again) - and thats the reason why it resets. actually since the base is just 0x0000FFFF it could be another reason.
i still don't get it. you write a game which switches from dos to pm... why don't you write a windows game - you have to whole interface. directX, ogl no probs with stack and the base of the system.
the way you go you have to implement *everything*.
btw... i almost get tired of writing code for you. i can't believe that the code worked you posted the last time.
xor eax,eax ; Base are Set here
mov si,11a
mov ax,cs
shl eax,4
mov [si],eax ;you still don't set the base for the 2nd selector!
mov si,011d
mov al,9a
mov [si],al ;<--
since you don't set the base of the 2nd selector the system resets the first time you access the data-selector. you set it also to the ss-register. a call pushes eip onto the stack (to return from the function again) - and thats the reason why it resets. actually since the base is just 0x0000FFFF it could be another reason.
Sorry, miss posted.