Subversion Repositories Kolibri OS

Rev

Rev 854 | Rev 864 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. format MS COFF
  3.  
  4.  
  5. include '../macros.inc'
  6.  
  7. $Revision: 849 $
  8.  
  9. __REV__ = __REV
  10.  
  11. include "../proc32.inc"
  12. include "../kglobals.inc"
  13. include "../lang.inc"
  14.  
  15. CR0_PE         equ    0x00000001   ;protected mode
  16. CR0_WP         equ    0x00010000   ;write protect
  17. CR0_PG         equ    0x80000000   ;paging
  18.  
  19. public _16bit_start
  20. public _16bit_end
  21.  
  22. public _enter_bootscreen
  23.  
  24. public _bx_from_load
  25.  
  26. extrn __setvars
  27.  
  28. section '.boot' code readable align 16
  29.  
  30. _16bit_start:
  31.  
  32. org 0
  33.  
  34. use16
  35.  
  36. _enter_bootscreen:
  37.  
  38.            mov eax, cr0
  39.            and eax, not 0x80000001
  40.            mov cr0, eax
  41.            jmp far 0x1000:start_of_code
  42.  
  43. version db    'Kolibri OS  version 0.7.1.0      ',13,10,13,10,0
  44.  
  45. include "bootstr.inc"     ; language-independent boot messages
  46. include "preboot.inc"
  47.  
  48. if lang eq en
  49. include "booteng.inc"     ; english system boot messages
  50. else if lang eq ru
  51. include "bootru.inc"      ; russian system boot messages
  52. include "ru.inc"          ; Russian font
  53. else if lang eq et
  54. include "bootet.inc"      ; estonian system boot messages
  55. include "et.inc"          ; Estonian font
  56. else
  57. include "bootge.inc"      ; german system boot messages
  58. end if
  59.  
  60. include "../data16.inc"
  61.  
  62. include "bootcode.inc"    ; 16 bit system boot code
  63. include "../bus/pci/pci16.inc"
  64. include "../detect/biosdisk.inc"
  65.  
  66. ;include "boot/shutdown.inc" ; shutdown or restart
  67.  
  68.            cli
  69.  
  70.            mov eax, cr0
  71.            or eax, CR0_PG+CR0_WP+CR0_PE
  72.            mov cr0, eax
  73.  
  74.            jmp pword 0x08:__setvars
  75.  
  76. align 4
  77. _enter_16bit:
  78.            mov eax, cr0
  79.            and eax, not 0x80000001
  80.            mov cr0, eax
  81.            jmp far 0x1000:@F
  82.  
  83. align 4
  84. _leave_16bit:
  85.  
  86.            cli
  87.            mov eax, cr0
  88.            or eax, CR0_PG+CR0_WP+CR0_PE
  89.            mov cr0, eax
  90.            hlt
  91.  
  92. align 4
  93. @@:
  94.            mov eax, 0x3000
  95.            mov ss, ax
  96.            mov esp, 0xEC00
  97.  
  98.            mov ebx, 0x1000
  99.            mov ds, bx
  100.            mov es, bx
  101.            cli
  102.            hlt
  103.  
  104. align 4
  105. _16bit_end:
  106.