[SOLVED] Jumping into real from protected mode

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
HugeCode
Member
Member
Posts: 112
Joined: Mon Dec 17, 2012 9:12 am

Re: Jumping into real from protected mode

Post by HugeCode »

I copied my working tables and changed granularity+D/B bytes.. Still same exception.... I give it up... For last time, can anybody see something wrong here?:

Code: Select all

; real code:				; code descriptor
	dw 0FFFFh 			; limit low
	dw 0 				; base low
	db 0 				; base middle
	db 10011010b 			; access
	db 00001111b 			; granularity
	db 0 				; base high
; real data:				; data descriptor
	dw 0FFFFh 			; limit low (Same as code)
	dw 0 				; base low
	db 0 				; base middle
	db 10010010b 			; access
	db 00001111b 			; granularity
	db 0				; base high
User avatar
DavidCooper
Member
Member
Posts: 1150
Joined: Wed Oct 27, 2010 4:53 pm
Location: Scotland

Re: Jumping into real from protected mode

Post by DavidCooper »

They're beautiful 16-bit protected mode descriptors. They are not for use in real mode, so you need to think about how you're going to get into real mode via 16-bit protected mode.
Help the people of Laos by liking - https://www.facebook.com/TheSBInitiative/?ref=py_c

MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming
HugeCode
Member
Member
Posts: 112
Joined: Mon Dec 17, 2012 9:12 am

Re: Jumping into real from protected mode

Post by HugeCode »

Can I use them for v8086 code?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Jumping into real from protected mode

Post by Combuster »

HugeCode wrote:Can I use them for v8086 code?
I think an RTFM qualifies here.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
HugeCode
Member
Member
Posts: 112
Joined: Mon Dec 17, 2012 9:12 am

Re: Jumping into real from protected mode

Post by HugeCode »

I found out where was the problem. My GDT wasn't set up to correct length and it was incomplete. Now everything works.
Post Reply