Rev 390 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 390 | Rev 393 | ||
---|---|---|---|
Line 91... | Line 91... | ||
91 | 91 | ||
Line 92... | Line 92... | ||
92 | mov ecx, CR0_PE |
92 | mov ecx, CR0_PE |
Line 93... | Line 93... | ||
93 | 93 | ||
Line 94... | Line 94... | ||
94 | ; Enabling 32 bit protected mode |
94 | ; Enabling 32 bit protected mode |
95 | 95 | ||
96 | ; sidt [cs:old_ints_h-0x10000] |
96 | sidt [cs:old_ints_h] |
97 | 97 | ||
Line 121... | Line 121... | ||
121 | or eax, ecx |
121 | or eax, ecx |
122 | and eax, 10011111b *65536*256 + 0xffffff ; caching enabled |
122 | and eax, 10011111b *65536*256 + 0xffffff ; caching enabled |
123 | mov cr0, eax |
123 | mov cr0, eax |
124 | jmp pword os_code:B32 ; jmp to enable 32 bit mode |
124 | jmp pword os_code:B32 ; jmp to enable 32 bit mode |
Line -... | Line 125... | ||
- | 125 | ||
- | 126 | include "boot/shutdown.inc" ; shutdown or restart |
|
125 | 127 | ||
126 | align 8 |
128 | align 8 |
Line 127... | Line 129... | ||
127 | tmp_gdt: |
129 | tmp_gdt: |
128 | 130 | ||
Line 204... | Line 206... | ||
204 | jmp pword os_code:high_code |
206 | jmp pword os_code:high_code |
Line 205... | Line 207... | ||
205 | 207 | ||
206 | __DEBUG__ fix 1 |
208 | __DEBUG__ fix 1 |
207 | __DEBUG_LEVEL__ fix 1 |
209 | __DEBUG_LEVEL__ fix 1 |
208 | include 'init.inc' |
- | |
Line 209... | Line 210... | ||
209 | include "boot/shutdown.inc" ; shutdown or restart |
210 | include 'init.inc' |
210 | 211 | ||
Line 211... | Line 212... | ||
211 | org OS_BASE+$ |
212 | org OS_BASE+$ |
Line 3287... | Line 3288... | ||
3287 | sub dl,2 |
3288 | sub dl,2 |
Line 3288... | Line 3289... | ||
3288 | 3289 | ||
3289 | cmp [SYS_SHUTDOWN],dl |
3290 | cmp [SYS_SHUTDOWN],dl |
Line 3290... | Line 3291... | ||
3290 | jne no_mark_system_shutdown |
3291 | jne no_mark_system_shutdown |
3291 | 3292 | ||
3292 | mov edx,0x3040 |
3293 | mov edx,OS_BASE+0x3040 |
3293 | movzx ecx,byte [SYS_SHUTDOWN] |
3294 | movzx ecx,byte [SYS_SHUTDOWN] |
3294 | add ecx,5 |
3295 | add ecx,5 |
3295 | markz: |
3296 | markz: |
Line 4869... | Line 4870... | ||
4869 | undefined_syscall: ; Undefined system call |
4870 | undefined_syscall: ; Undefined system call |
Line 4870... | Line 4871... | ||
4870 | 4871 | ||
4871 | mov [esp+36],dword -1 |
4872 | mov [esp+36],dword -1 |
Line -... | Line 4873... | ||
- | 4873 | ret |
|
- | 4874 | ||
- | 4875 | align 4 |
|
- | 4876 | system_shutdown: ; shut down the system |
|
- | 4877 | ||
- | 4878 | cmp byte [BOOT_VAR+0x9030], 1 |
|
- | 4879 | jne @F |
|
- | 4880 | ret |
|
- | 4881 | @@: |
|
- | 4882 | call stop_all_services |
|
- | 4883 | ||
- | 4884 | push eax |
|
- | 4885 | push edx |
|
- | 4886 | mov edx, 0x400 ;bocsh |
|
- | 4887 | mov al,0xff ;bocsh |
|
- | 4888 | out dx, al ;bocsh |
|
- | 4889 | pop edx |
|
- | 4890 | pop eax |
|
- | 4891 | ||
- | 4892 | push 3 ; stop playing cd |
|
- | 4893 | pop eax |
|
- | 4894 | call sys_cd_audio |
|
- | 4895 | ||
- | 4896 | yes_shutdown_param: |
|
- | 4897 | cli |
|
- | 4898 | ||
- | 4899 | mov eax, kernel_file ; load kernel.mnt to 0x8000:0 |
|
- | 4900 | push 12 |
|
- | 4901 | pop esi |
|
- | 4902 | xor ebx,ebx |
|
- | 4903 | or ecx,-1 |
|
- | 4904 | mov edx, OS_BASE+0x80000 |
|
- | 4905 | call fileread |
|
- | 4906 | ||
- | 4907 | mov esi, restart_kernel_4000+OS_BASE+0x10000 ; move kernel re-starter to 0x4000:0 |
|
- | 4908 | mov edi,OS_BASE+0x40000 |
|
- | 4909 | mov ecx,1000 |
|
- | 4910 | rep movsb |
|
- | 4911 | ||
- | 4912 | mov esi,OS_BASE+0x2F0000 ; restore 0x0 - 0xffff |
|
- | 4913 | mov edi, OS_BASE |
|
- | 4914 | mov ecx,0x10000/4 |
|
- | 4915 | cld |
|
- | 4916 | rep movsd |
|
- | 4917 | ||
- | 4918 | call restorefatchain |
|
- | 4919 | ||
- | 4920 | mov al, 0xFF |
|
- | 4921 | out 0x21, al |
|
- | 4922 | out 0xA1, al |
|
- | 4923 | ||
- | 4924 | mov word [OS_BASE+0x467+0],pr_mode_exit |
|
- | 4925 | mov word [OS_BASE+0x467+2],0x1000 |
|
- | 4926 | ||
- | 4927 | mov al,0x0F |
|
- | 4928 | out 0x70,al |
|
- | 4929 | mov al,0x05 |
|
- | 4930 | out 0x71,al |
|
- | 4931 | ||
- | 4932 | mov al,0xFE |
|
- | 4933 | out 0x64,al |
|
- | 4934 | hlt |
|
4872 | ret |
4935 | |
Line 4873... | Line 4936... | ||
4873 | 4936 | ||
4874 | include "data32.inc" |
4937 | include "data32.inc" |