VOGONS

Common searches


Search results

Display options

Why is 32bit Protected Mode not working in DOS Box?

Here's my code for simply switching to protected mode, and then running an infinite loop. Unfortunately it crashes. Below is the full NASM assembly language code for this program. It is fully commented, so you can easily see what each piece of code does. The line of code that isn't working is marked …

Re: Question about GDT

You need to do the jump last. What the jump does is it forces the CPU to reload the CS. The CPU then detects that it is in Protected Mode and therefore rather than using the CS at face value it uses it instead to to index in GDT. Also a far jump will clear the prefetch queue. That is why the jump …

Re: Question about GDT

Nothing stops you from having 2 GDT entries one selected by CS where read bit is on and one selected by DS where write bit is on. As long as you write to [DS:offset] you are good then you can jump to CS:offset. However on more modern CPUs (read 64bit) and more modern OSes self modifying code does …

Question about GDT

I've been reading about setting up protected mode, and I found this good article about the GDT (Global Descriptor Table) http://wiki.osdev.org/Global_Descriptor_Table , but I noticed something peculiar. It says that data segments can be set to read-write, or read-only, while code segments can be …

Re: How does an x86 CPU swtich from 16 to 32bit mode?

I know Windows does with the concept of user mode and kernel mode. I think user mode in Windows (also known as ring-3, and is what all applications run in) is just a fancy name for protected mode, and kernel mode (also known as ring-0, and is accessible only to the OS itself and certain drivers) is …

Bug in DosBox involving mov opcode

The code segment register modifier 0x8EC8 (which is the result of assembling the asm command "mov cs,ax") is supposed to transfer the 16bit value stored in the ax register into the cs register, but it's not working. In the the Dosbox Debugger, the debugging console is showing that it's producing the …

Re: How does an x86 CPU swtich from 16 to 32bit mode?

Of course it's not possible to call a real-mode interrupt directly from protected mode; it's necessary to first switch back to real mode. DOS programs that use protected mode typically employ an interface that eliminates most of the hassles -- some flavor of DPMI or an extender that includes DPMI ( …

Re: How does an x86 CPU swtich from 16 to 32bit mode?

In addition to giving access to more memory, protected mode also switches the CPU into using 32-bit registers by default. If you want to use 32-bit registers in real mode then the 66h prefix byte is the only way. Most assemblers will add the prefix byte and use 32-bit constants automatically if you …

Re: How does an x86 CPU swtich from 16 to 32bit mode?

http://wiki.osdev.org/Protected_Mode http://wiki.osdev.org/Real_Mode I know there is real versus protected mode, but I would like to know how to use 32bits in real mode, not switch to protected mode for 32bit access. Protected mode, if I'm not mistaken, is what Windows uses, and prevents you from …

How does an x86 CPU swtich from 16 to 32bit mode?

I know that the opcode prefix 0x66 tells the CPU that the following opcode is to behave an opcode for a different bitness. For example, if the CPU is in 32bit mode, the prefix 0x66 tells it to treat the following opcode as a 16bit instruction (it will use 16bit registers like AX and DX instead of …

Re: Question about CGA graphics

Ok, well I couldn't find it anywhere on the net (guess not enough people into programming retro PC graphics software to bother documenting CGA addresses), but through trial and error, I eventually discovered what the address of the second image field is. It is 0xBA000 (or BA00h:0000h if using …

Question about CGA graphics

In CGA 320x200 4-color modes (video modes 4 and 5), what exactly are the starting memory addresses for the 2 fields? I know it is divided into 2 fields of alternating lines, rather than one continuous picture like in VGA mode. I know that the first field (lines 0, 2, 4, 6, etc) start at address …

Page 7 of 10