From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu From: andrey mirtchovski MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20020123234412.1ABFF19A02@mail.cse.psu.edu> Subject: [9fans] calculating the gdt pointer in 32 bit (protected) mode Date: Wed, 23 Jan 2002 16:43:46 -0700 Topicbox-Message-UUID: 42b6ec42-eaca-11e9-9e20-41e7f4b1d025 hello, i'm trying to understand how the gdt pointer is calculated in /sys/src/boot/pc/l.s .. the exercise includes calculating this pointer when already in 32 bit mode and i'm kind of lost at this point... here's the relevant code snippet: /* * pointer to initial gdt */ TEXT tgdtptr(SB),$0 WORD $(3*8) LONG $tgdt-KZERO(SB) /* * goto protected mode */ /* MOVL tgdtptr(SB),GDTR /**/ BYTE $0x0f BYTE $0x01 BYTE $0x16 WORD $tgdtptr(SB) MOVL CR0,AX ORL $1,AX MOVL AX,CR0 using MOVL tgdtptr(SB),GDTR to calculate the gdt pointer when already in protected mode crashes the machine, although not immediately... thanx, andrey