home *** CD-ROM | disk | FTP | other *** search
- --- linux-1.1.47-clean/arch/i386/boot/setup.S Wed Aug 24 20:11:49 1994
- +++ linux/arch/i386/boot/setup.S Mon Aug 29 21:35:11 1994
- @@ -21,6 +21,7 @@
- ! NOTE! These had better be the same as in bootsect.s!
- #include <linux/config.h>
- #include <linux/segment.h>
- +#include "../tools/version.h"
-
- #ifndef SVGA_MODE
- #define SVGA_MODE ASK_VGA
- @@ -45,6 +46,37 @@
-
- entry start
- start:
- + jmp start_of_setup
- +! ------------------------ start of header --------------------------------
- +!
- +! SETUP-header, must start at 0x9020:2
- +!
- +! Currently it is used only by LOADLIN to intercept SETUP just in front of
- +! protected mode transition.
- +! LOADLIN is a DOS-program which can boot Linux, like BOOTLIN does, but
- +! supporting the Linux command line.
- +! Opposite to LILO and BOOTLIN, which both require the CPU to be in real mode,
- +! LOADLIN can switch back from virtual 8086 mode (V86) to real mode using
- +! the VCPI interface of EMS drivers.
- +! Before starting SETUP LOADLIN overwrites realmode_swtch with it's own
- +! routine and start_sys_seg with the actual location of the compressed image
- +! (which may be higher then 0x10000, but not below 0x2000). This avoids
- +! overwriting of resident DOS drivers so that the first part of SETUP can be
- +! run in V86 mode.
- +! The intercept routine of LOADLIN then does:
- +! 1. Disables NMI and normal interrupts.
- +! 2. Switches from V86 to real mode.
- +! 3. returns to SETUP leaving interrupts disbled.
- +! All registers are preserved
- +!
- + .ascii "HdrS" ! Signature for SETUP-header
- + .word 0x0105 ! Version number of header
- +realmode_swtch: .word default_switch,SETUPSEG
- +start_sys_seg: .word SYSSEG
- + .word kernel_version ! pointing to kernel version string
- +! ------------------------ end of header ----------------------------------
- +
- +start_of_setup:
- ! Bootlin depends on this being done early
- mov ax,#0x01500
- mov dl,#0x81
- @@ -85,7 +117,6 @@
-
- no_sig_mess: .ascii "No setup signature found ..."
- db 0x00
- -start_sys_seg: .word SYSSEG
-
- good_sig1:
- jmp good_sig
- @@ -232,9 +263,8 @@
- no_psmouse:
- ! now we want to move to protected mode ...
-
- - cli ! no interrupts allowed !
- - mov al,#0x80 ! disable NMI for the bootup sequence
- - out #0x70,al
- + seg cs
- + callf far * realmode_swtch
-
- ! first we move the system to its rightful place
-
- @@ -245,8 +275,6 @@
- do_move:
- mov es,ax ! destination segment
- inc ah ! instead of add ax,#0x100
- - cmp ax,#0x9000
- - jz end_move
- mov ds,bx ! source segment
- add bx,#0x100
- sub di,di
- @@ -254,7 +282,11 @@
- mov cx,#0x800
- rep
- movsw
- - jmp do_move
- + cmp bx,#0x9000 ! we assume start_sys_seg > 0x200,
- + ! so we will perhaps read one page more then
- + ! needed, but never overwrite 0x9000 because
- + ! destination is minimum one page below source
- + jb do_move
-
- ! then we load the segment descriptors
-
- @@ -337,6 +369,24 @@
- jmp flush_instr
- flush_instr:
- jmpi 0x1000,KERNEL_CS ! jmp offset 1000 of segment 0x10 (cs)
- +
- +kernel_version: .ascii UTS_RELEASE
- + .ascii " ("
- + .ascii LINUX_COMPILE_BY
- + .ascii "@"
- + .ascii LINUX_COMPILE_HOST
- + .ascii ") "
- + .ascii UTS_VERSION
- + db 0
- +
- +! This is the default real mode switch routine.
- +! to be called just before protected mode transition
- +
- +default_switch:
- + cli ! no interrupts allowed !
- + mov al,#0x80 ! disable NMI for the bootup sequence
- + out #0x70,al
- + retf
-
- ! This routine checks that the keyboard command queue is empty
- ! (after emptying the output buffers)
-