ejemplos modo protegido.pdf

Vista previa de texto
.reg_ECX
.reg_EDX
.reg_EBX
.reg_ESP
.reg_EBP
.reg_ESI
.reg_EDI
.reg_ES
.reg_CS
.reg_SS
.reg_DS
.reg_FS
.reg_GS
.reg_LDT
.reg_T
.reg_IOMAP
.IOMAP
resd
resd
resd
resd
resd
resd
resd
resw
resw
resw
resw
resw
resw
resw
resw
resw
resw
resw
resw
resw
resw
resw
resd
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
endstruc
;
; Se definen las pilas, reservando 256 bytes para cada una. El label fin
; está al final del ejecutable.
;
%define pila_sup
fin+100h
%define pila_inf
fin+200h
;
; Una vez definida la estructura de los tss, se los debe inicializar,
; salvo al primero de ellos, ya que no será necesario. Lo mínimo
; necesario es inicializar la pila actual, el cs:eip, el IOMAP en ff el
; último byte, y en este caso se habilitan las interrupciones.
;
TSS_inicial_struc: resb tss_struc_size
TSS_sup_struc istruc tss_struc
at tss_struc.reg_EIP,
dd tarea_sup
at tss_struc.reg_EFLAGS,
dd 202h
at tss_struc.reg_ESP,
dd pila_sup
at tss_struc.reg_CS,
dw code_sel
at tss_struc.reg_SS,
dw data_sel
at tss_struc.reg_IOMAP,
dw 104
at tss_struc.IOMAP,
dd 0ffffffffh
iend
;
TSS_inf_struc istruc tss_struc
at tss_struc.reg_EIP,
dd tarea_inf
at tss_struc.reg_EFLAGS,
dd 202h
at tss_struc.reg_ESP,
dd pila_inf
at tss_struc.reg_CS,
dw code_sel
at tss_struc.reg_SS,
dw data_sel
at tss_struc.reg_IOMAP,
dw 104
at tss_struc.IOMAP,
dd 0ffffffffh
iend
;
; Se ralizan las tareas superior e inferior. La primera incrementa un
; valor y lo imprime en pantalla.
;
