duh () {			# tidy up $listing
	opnote $*
	HL
}


L IGDTRpointer
HL               	       # herelist
        ad  0x400		# small gdt limit 
        aq  $GDT		# comin right up...

L GDT
HL
 aq 0 0 
duh  "0 the required NULL" 


mddefaults
mdtype=$AvailableTSS32
 mdinstantiate
duh  "1 0x8 TSS stackstack"



mddefaults 
 mdinstantiate
duh "2 0x10 ring0 USE32 CS"

CS32=0x10


mddefaults
mdwritedata=1
mdexecutable=0
 mdinstantiate
duh  "3 0x18  ring0 data" 

DS32=0x18


mddefaults
mdUSE32=0
mdlimitshifted=0
mdlimit=0xffff
 mdinstantiate
duh  "4 0x20 USE16 CS" 

CS16=0x20


mddefaults
mdUSE32=0
mdlimit=0xffff
mdwritedata=1
mdlimitshifted=0
mdexecutable=0
   mdinstantiate
duh  "5 0x28 USE16 data ?S" 

DS64k=0x28

 aq 0 0 
duh  "6 0x30" 
 aq 0 0 
duh  "7 0x38" 
 aq 0 0 
duh  "8 0x40" 
 aq 0 0 
duh  "9 0x48" 

# do   . makedescriptor    elsewhere or interactively 

# refer to the mddefaults() in ./makedescriptor for what the options are.
# The default makes a big flat CS, which see 0x10 above.

# You need 64k segments for canonical rmode, but not USE32+PE=0.




#aq 0 0
#duh "10 0x50"
#aq 0 0
#duh "11 0x58"
# aq 0 0
#duh  "12 0x60"
# aq 0 0
#duh  "13 0x60"
# aq 0 0 
#duh  "14 0x70" 
# aq 0 0 
#duh  "15 0x78" 
#
#mddefaults 
#mdDPL=1
#mdexecutable=0
# mdinstantiate
#duh "16 0x80 RING 0A DS"
#
#
#mddefaults
#mdlimit=0xffff
#mdlimitscaled=0
#mdexecutable=0
#mdwritedata=1
#mdDPL=0
#mdUSE32=0				#  small SP for BIOS supposedly
# mdinstantiate
#duh  "17 0x88 ring0 small SS" 
#
#
#mddefaults 
#mdDPL=1
#mdbase=0x90000
#mdexecutable=0
# mdinstantiate
#duh "18 0x90 RING 0A SS"
#
# aq 0 0
#duh  "19 0x98"
# aq 0 0
#duh  "20 0xa0"
# aq 0 0
#duh  "21 0xa8"
# aq 0 0
#duh  "22 0xb0"
#
#
#mddefaults
#mdwritedata=1
#mdlimit=0xffff
#mdlimitscaled=0
#mdbase=0xb8000
#mdexecutable=0
# mdinstantiate
#duh "23 0xb8 VGA data"
#
#mddefaults
#mdlimit=0xffff
#mdlimitscaled=0
#mdbase=0xc0000
#mdUSE32=0
# mdinstantiate
#duh "24 0xc0 VidBIOS CS"
#
# aq 0 0
#duh  "25 0xc8"
# aq 0 0
#duh  "26 0xd0"
# aq 0 0
#duh  "27 0xd8"
#
#mddefaults 
#mdbase=0xe0000
#mdlimit=0xd000
#mdexecutable=0
#mdwritedata=1
# mdinstantiate
#duh  "28 0xe0"
#
# aq 0 0
#duh  "29 0xe8"
#
#mddefaults
#mdlimit=0xffff
#mdlimitscaled=0
#mdbase=0xf0000
#mdUSE32=0
# mdinstantiate
#duh "30 0xf0 BIOS CS"
#
#mddefaults
#mdlimit=0xffff
#mdlimitscaled=0
#mdbase=0x90000
#mdDPL=0
#mdUSE32=0
#mdexecutable=1
# mdinstantiate
#duh  "31 0xf8 test seg 0x90000"
#


# initial Global Descriptor Table data, built with some custom osimplay,
#  makedescriptor.
# Probably inadequate for multi-user, but I don't get LDTs yet, so 
#   maybe not.
# One small initial GDT should suffice for various modoids. 
# Not so for IDTs.
# Descriptors are unchangeable when PE=0. 
# Big init segments (descriptors) are useable for PE=0.



