inter

I 9 d I mov mov xor II d I

mov I I r

80286 SYSTEM INITIALIZATION

I em p_. I a c k [ bpi

U.e

I n I I I a I

GDT

I n

RAM arel

 

ax, lemp_. tac k -I n I I lal_gdl

; Selup SS

wI I h

vall d

prolected mode

!!IS,IIX

.eleclor 10 Ihe RAM

GDT

and

• I a ok

a x I a x

Sel Ihe current LDT 10 null

 

ax

Any

references

10

I I

will

CIlU!!Ie

 

an excepllon cau.lng .huld.wn

a x, • a v e_ I •• - I n I I I a I_g d I

Set

I n I I I a I

TSS

I n I 0

I he

10.

RAM

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

Jb

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 mI 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 , 9d 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

copy_task_loop: call add mov

or

Jnz

With

 

Define

list of

tasks 10 setup

copy_la.ks

Copy

them

Inlo

RAM

b x , s I z e I ask _e n try

Go to

 

next

entry

ax,cl: [bxl. tss_sel

See If

Ihere Is

another enlry

ax,.x

copy_la.k_loop

TSS, GDT, and LDT set, .tarlup the Initial task!

mov

b x, 9 d t_a Ila.

mov

d. , b x

mov

b x , I d .I_a I I a •

II d t

[b x I

Jmp

.tart_polnter[bpl

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

A-5

Page 203
Image 203
Intel 80286, 80287 manual Ax,.x