3 ; NetWatch system management mode administration console
5 ; Copyright (c) 2008 Jacob Potter and Joshua Wise. All rights reserved.
6 ; This program is free software; you can redistribute and/or modify it under
7 ; the terms found in the file LICENSE in the root of this source tree.
12 mov ax, 0xA800 ; Take us out of flat unreal mode,
13 mov ds, ax ; and put us in true real mode.
18 jmp 0xA800:(entry2-0xA8000) ; Long jump to a correct cs.
20 lgdt [(gdtr-0xA8000)] ; Set up a new GDT.
22 mov cr0, eax ; ... and enter pmode!
23 jmp long 0x10:continue ; Now longjmp into the new code.
26 mov ax, 0x08 ; Set up segment selectors.
32 mov esp, [dataptr] ; Load stack pointer.
34 ; Before we do anything, turn off alignment checking.
41 mov eax, [dataptr+4] ; Load target jump address
42 call eax ; then jump into C.
52 db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ; initial null entry
53 db 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x93, 0xCF, 0x00 ; data segment
54 db 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x9B, 0xCF, 0x00 ; code segment
58 ; 4 bytes of stack top
59 ; 4 bytes of C entry point