bits 32
.in_pm:
- mov eax,PM_DS32
+ mov ax,PM_DS32
mov ss,eax
lea esp,[ebp-8*4-2*4] ; Flat mode stack
mov es,eax
; machine running on Intel VT hardware -- it can't
; deal with a partial transition, for no good reason.
- mov al,PM_DS16_RM ; Real-mode-like segment
+ mov al,PM_DS16 ; Real-mode-like segment
mov fs,eax
mov gs,eax
mov al,PM_TSS ; Intel VT really doesn't want
jmp PM_CS16:.exit
bits 16
.exit:
- mov eax,PM_DS16_RM ; "Real-mode-like" data segment
+ mov ax,PM_DS16 ; "Real-mode-like" data segment
mov es,eax
mov ds,eax
mov ss,eax
call .here
.here: pop ebx
mov eax,edi
- add ebx,bcopy_gdt.CS16-.here
- mov [ebx+2],ax
+ add ebx,bcopy_gdt-.here
+ mov [ebx+PM_CS16+2],ax
+ mov [ebx+PM_DS16+2],ax
shr eax,16
- mov [ebx+4],al
- mov [ebx+7],ah
- mov eax,PM_DS16_RM
+ mov [ebx+PM_CS16+4],al
+ mov [ebx+PM_CS16+7],ah
+ mov [ebx+PM_DS16+4],al
+ mov [ebx+PM_DS16+7],ah
+ mov ax,PM_DS16
mov ds,eax
mov es,eax
mov fs,eax
desc CS16
dd 0000ffffh ; 10h Code segment, use16, readable,
dd 00009b00h ; present, dpl 0, cover 64K
- desc DS16_RM
+ desc DS16
dd 0000ffffh ; 18h Data segment, use16, read/write,
dd 00009300h ; present, dpl 0, cover 64K
desc CS32
bits 16
.in_pm16:
- mov ax,PM_DS16_RM ; Real-mode-like segment
+ mov ax,PM_DS16 ; Real-mode-like segment
mov es,ax
mov ds,ax
mov ss,ax
and possibly other virtualization solutions.
In both mode 0 and mode 1, the data segments will be loaded
- with base-zero read/write segments. For mode 0, B=0 and the
- limits will be 64K, for mode 1, B=1 and the limits will be 4 GB.
+ with read/write data segments, matching the respective code
+ segment. For mode 0, B=0 and the limits will be 64K, for mode
+ 1, B=1 and the limits will be 4 GB.