2 ; Routines to return the system to real mode
3 ; NetWatch multiboot loader
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.
9 [bits 32] ; Starts in 32 bit mode, then will drop back later.
13 ; clean up 32 bit regs
32 jmp 0x8:nextp ; Clear CS bits now too
37 xor eax, 0x1 ; Clear PE
40 jmp 0x0:nowreal ; and jmp away
52 mov sp, 0xFFFF ; set up the stack
63 int 0x19 ; warm boot without clearing RAM.
64 call handload_drive ; hopefully shouldn't happen
81 ; handload_drive should be unnecessary; int 19 should take care of it for
86 mov ax, 0x0201 ; read one sector
87 mov bx, 0x0000 ; to the normal location
88 mov cx, 0x0001 ; disk sector 1
89 mov dx, 0x0080 ; drive 0
96 jmp 0x7C0:0x0 ; and return control to grub!
102 RETMSG db "SMM installer finished, booting your system of choice.",10,13,0
103 READSUCC db "Read successful; rebooting into boot sector.",10,13,0
104 READFAIL db "Boot disk read failure; system halted.",10,13,0
107 idtp db 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00
113 dd 0x0000FFFF, 0x00009e00 ; CS
114 dd 0x0000FFFF, 0x00009300 ; DS