[Solved] BIOS I/O function causing older systems to freeze

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.
pranavappu007
Member
Member
Posts: 91
Joined: Mon Apr 20, 2020 11:02 am

Re: BIOS I/O function causing older systems to freeze

Post by pranavappu007 »

Octocontrabass wrote:Only if you haven't made a mistake somewhere else
could you point me to areas or possible mistakes that I have done that can make this issue?
I don't know if it means something in real mode, but here is the gdt table I used to switch to 16-bit protected mode. This is the only thing left to actually do a check, I suppose.

Code: Select all

null_16:						;NULL gdt
	dd 0x0
	dd 0x0
	
gdt_code_16:					;code segment descriptor
	dw 0xffff				
	dw 0x0					
	db 0x0					
	db 10011010b
	db 00001111b
	db 0x0
gdt_data_16:					;Data segment Descriptor
	dw 0xffff
	dw 0x0
	db 0x0
	db 10010010b ; 1 st flags , type flags
	db 00001111b ; 2 nd flags , Limit ( bits 16 -19)
	db 0x0
A beginner developer/student. Likes to know stuff. Don't have an OS to put here.
pranavappu007
Member
Member
Posts: 91
Joined: Mon Apr 20, 2020 11:02 am

Re: BIOS I/O function causing older systems to freeze

Post by pranavappu007 »

First of all, Thanks for eveyone for your support. Yess, I got it working! PeterX told me about an Unreal Mode as a possibility. But I didn't get it so I left it there. Later I thought well, let's check that out and found that processors have a Descriptor Cache that don't clear when switching over to real mode, so you get this weird mode where you are running in 16-bit mode but can access upto 4GB.

So I thought maybe am in unreal mode and the bios using es:bx is causing problem. So, what I did is reset the segment registers to flush the descriptor cache before real mode. And that was it! It worked!! Thanks to all 3 of you for helping me out to narrow down the problem this much.

I think this is needed for older processors to function properly.
A beginner developer/student. Likes to know stuff. Don't have an OS to put here.
Post Reply