home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / KERNELS / LODLIN15.ZIP / LOADLIN / KERNEL / 1-1-47.DIF < prev    next >
Encoding:
Text File  |  1994-08-29  |  3.4 KB  |  116 lines

  1. --- linux-1.1.47-clean/arch/i386/boot/setup.S    Wed Aug 24 20:11:49 1994
  2. +++ linux/arch/i386/boot/setup.S    Mon Aug 29 21:35:11 1994
  3. @@ -21,6 +21,7 @@
  4.  ! NOTE! These had better be the same as in bootsect.s!
  5.  #include <linux/config.h>
  6.  #include <linux/segment.h>
  7. +#include "../tools/version.h"
  8.  
  9.  #ifndef SVGA_MODE
  10.  #define SVGA_MODE ASK_VGA
  11. @@ -45,6 +46,37 @@
  12.  
  13.  entry start
  14.  start:
  15. +    jmp    start_of_setup
  16. +! ------------------------ start of header --------------------------------
  17. +!
  18. +! SETUP-header, must start at 0x9020:2
  19. +!
  20. +! Currently it is used only by LOADLIN to intercept SETUP just in front of
  21. +! protected mode transition.
  22. +! LOADLIN is a DOS-program which can boot Linux, like BOOTLIN does, but
  23. +! supporting the Linux command line.
  24. +! Opposite to LILO and BOOTLIN, which both require the CPU to be in real mode,
  25. +! LOADLIN can switch back from virtual 8086 mode (V86) to real mode using
  26. +! the VCPI interface of EMS drivers.
  27. +! Before starting SETUP LOADLIN overwrites realmode_swtch with it's own
  28. +! routine and start_sys_seg with the actual location of the compressed image
  29. +! (which may be higher then 0x10000, but not below 0x2000). This avoids 
  30. +! overwriting of resident DOS drivers so that the first part of SETUP can be 
  31. +! run in V86 mode.
  32. +! The intercept routine of LOADLIN then does:
  33. +!   1.  Disables NMI and normal interrupts.
  34. +!   2.  Switches from V86 to real mode.
  35. +!   3.  returns to SETUP leaving interrupts disbled.
  36. +!   All registers are preserved
  37. +!
  38. +    .ascii    "HdrS"        ! Signature for SETUP-header
  39. +    .word    0x0105        ! Version number of header
  40. +realmode_swtch:    .word    default_switch,SETUPSEG
  41. +start_sys_seg:    .word    SYSSEG
  42. +    .word    kernel_version    ! pointing to kernel version string
  43. +! ------------------------ end of header ----------------------------------
  44. +
  45. +start_of_setup:
  46.  ! Bootlin depends on this being done early
  47.      mov    ax,#0x01500
  48.      mov    dl,#0x81
  49. @@ -85,7 +117,6 @@
  50.      
  51.  no_sig_mess:    .ascii    "No setup signature found ..."
  52.          db    0x00
  53. -start_sys_seg:    .word    SYSSEG
  54.  
  55.  good_sig1:
  56.      jmp    good_sig
  57. @@ -232,9 +263,8 @@
  58.  no_psmouse:
  59.  ! now we want to move to protected mode ...
  60.  
  61. -    cli            ! no interrupts allowed !
  62. -    mov    al,#0x80    ! disable NMI for the bootup sequence
  63. -    out    #0x70,al
  64. +    seg cs
  65. +    callf    far * realmode_swtch
  66.  
  67.  ! first we move the system to its rightful place
  68.  
  69. @@ -245,8 +275,6 @@
  70.  do_move:
  71.      mov    es,ax        ! destination segment
  72.      inc    ah        ! instead of add ax,#0x100
  73. -    cmp    ax,#0x9000
  74. -    jz    end_move
  75.      mov    ds,bx        ! source segment
  76.      add    bx,#0x100
  77.      sub    di,di
  78. @@ -254,7 +282,11 @@
  79.      mov     cx,#0x800
  80.      rep
  81.      movsw
  82. -    jmp    do_move
  83. +    cmp    bx,#0x9000    ! we assume start_sys_seg > 0x200,
  84. +                ! so we will perhaps read one page more then
  85. +                ! needed, but never overwrite 0x9000 because
  86. +                ! destination is minimum one page below source
  87. +    jb    do_move
  88.  
  89.  ! then we load the segment descriptors
  90.  
  91. @@ -337,6 +369,24 @@
  92.      jmp    flush_instr
  93.  flush_instr:
  94.      jmpi    0x1000,KERNEL_CS    ! jmp offset 1000 of segment 0x10 (cs)
  95. +
  96. +kernel_version:    .ascii    UTS_RELEASE
  97. +        .ascii    " ("
  98. +        .ascii    LINUX_COMPILE_BY
  99. +        .ascii    "@"
  100. +        .ascii    LINUX_COMPILE_HOST
  101. +        .ascii    ") "
  102. +        .ascii    UTS_VERSION
  103. +        db    0
  104. +
  105. +! This is the default real mode switch routine.
  106. +! to be called just before protected mode transition
  107. +
  108. +default_switch:
  109. +    cli            ! no interrupts allowed !
  110. +    mov    al,#0x80    ! disable NMI for the bootup sequence
  111. +    out    #0x70,al
  112. +    retf
  113.  
  114.  ! This routine checks that the keyboard command queue is empty
  115.  ! (after emptying the output buffers)
  116.