; tables for use in protected mode, including the gdt, idt, and relevant tss's * ;*******************************************************************************
;for use with v86.asm, etc.
;a gdt entry has the following form:
; dw ? ;segment limit ; db ?,?,? ;24 bits of absolute address ; db ? ;access rights ; db ? ;extended access rights ; db ? ;high 8 bits of 32 bit absolute address
gdt dq 0 ;first gdt entry must be 0
dw 0ffffh ;bios data selector (at 0:0)
db 0,0,0 db typ_read_write or dtype_memory or dpl_0 or present db granular_4k ;you can get at any @ in low memory with this db 0
dw tss_size ;tss for task 1 (startup)
dw offset tss_1 db 11h db typ_task or dpl_0 or present db 0,0
dw 0ffffh ;task 1 code segment selector
db 0,0,11h ;starts at 110000h db typ_exec_read or dtype_memory or dpl_0 or present db type_32,0
dw 0ffffh ;task 1 data selector
db 0,0,11h ;at 110000h db typ_read_write or dtype_memory or dpl_0 or present db type_32,0
dw tss_size+iomap_size ;tss for task 2
dw offset tss_2 db 11h tss_typefl: db typ_task or dpl_3 or present dw 0
dw 00fffh ;video ram selector
dw (video_seg shl 4) and 0ffffh db video_seg shr 12 db typ_read_write or dtype_memory or dpl_0 or present db 0,0
;end of gdt
;this is the task state segment for the virtual machine