User's Manual

inter
80286
SYSTEM INITIALIZATION
I 9 d I
I
em
p_.
I a c k [
bpi
U.e
I n I I I a I
GDT
I n
RAM
arel
mov
ax,
lemp_.
tac
k
-I
n I I
lal_gdl
;
Selup
SS
w I I h
vall
d
prolected
mode
mov
!!IS,IIX
.eleclor
10
Ihe
RAM
GDT
and I a
ok
xor
a x I a x
Sel
Ihe
current
LDT
10
null
II
d I
ax
Any
references
10
I I
will
CIlU!!Ie
an
excepllon
cau.lng
.huld.wn
mov
a
x,
a v
e_
I
••
- I n I I I a
I_g
d I
Set
I n I I I a I
T S S I n I 0 I he
10.
RAM
I I r
a x
The I a k
.wllch
need.
a
vall
d
TSS
Copy
Ihe
EPROM-ba.ed
GDT
Inlo
Ihe
RAM
data
.egmenl
0110
•.
Flr.1
the
descrlplor
for
the
RAM
data
segmenl
must
be
copied
Into
the
temporary
GDT.
mov
cmp
J b
mov
mov
call
mov
mov
c a I 1
mov
mov
mov
I 9 d t
a x , 9 d
t_d
e!C
[
bpI.
II
m I I
ax,S'slze
desc-!
bad_gdl
b
x,
9 d
t_d
e.
c - I
nit
lal_g
d I
.I,gdt_allas
copy_EPROM_dt
s I , I d
I_a
II
a s
b
x,
I d
I_d
esc
- I n I I I a
I_g
d I
copy_EPROM_dl
a x , 9 d t
_d
esc
- I
nit
I a
I_g
d I
d s , a x
bx,gdt_allas
[b
x I
Gel
size
of
GDT
Be
.ure
Ihe
lasl
enlry
expecled
by
this
code
Is
Inside
Ihe
GDT
Jump
If
GDT
I.
not
big
enough
Form
selector
10
EPROM
GDT
Get
selector
of
GDT
alias
Copy
Into
EPROM
Get
selector
of
lDT
alias
[ndlcate
EPROM
[DT
Setup
addre.slng
Inlo
EPROM
GDT
Gel
GDT
alia.
data
segmenl
.elector
Sel
GDT
to
RAM
GDT
SS
and
TR
remain
In
low
RAM
Copy
all
task's
TSS
and
LDT
.•
egmenls
Inlo
RAM
I e a
Define
list
of
tasks
10
setup
copy_task_loop:
call
add
copy_la.ks
b x , s I z e I
ask
_e
n
try
ax,cl:
[bxl.
tss_sel
Copy
them
Inlo
RAM
Go
to
next
entry
mov
See
If
Ihere
Is
another
enlry
or
ax,.x
Jnz
copy_la.k_loop
With
TSS,
GDT,
and
LDT
set,
.tarlup
the
Initial
task!
mov
mov
mov
II
d t
Jmp
b
x,
9 d
t_a
Ila.
d.
, b x
b x , I d
.I_a
I I a •
[b
x I
.tart_polnter[bpl
A-5
Potnt
DS
at
GDT
Get
lDT
alias
data
.egment
.elector
Set
[DT
for
errors
and
Interrupt.
Slarl
Ihe
flrsl
lask!
The low
RAM
area
Is
overwrllten
with
Ihe
current
CPU
conlexl
Halt
here
If
GDT
Is
not
big
enough