?? pm2d.asm
字號:
;=========================================================;
; Real/Pmode 11/12/03 ;
;---------------------------------------------------------;
; DOS EXTREME OS V0.01 ;
; by Craig Bamford. ;
; ;
; fasm pm os test EXE program (DOS EXTREME) ;
; fasm pm.asm pm.exe ;
; ;
; Thanks to: Tomasz Grysztar,Christopher Giese ;
; Alexei A. Frounze, smaffy. ;
; ;
;=========================================================;
format MZ ; code starts at offset 100h
;===============================================================================================;
; 16-bit real mode
;===============================================================================================;
use16
jmp start
include '386.inc'
include 'vesa2.inc'
start:
push cs
pop ds
mov ax,ds
mov es,ax
call vesa
call enable_A20
xor ebx,ebx
mov bx,ds ; BX=segment
shl ebx,4 ; BX="linear" address of segment base
mov eax,ebx
mov [sys_code_1 + 2],ax ; set base address of 32-bit segments
mov [sys_data_1 + 2],ax
mov [Real_code_1 + 2],ax ; set base address of 16-bit segments
mov [Real_data_1 + 2],ax
shr eax,16
mov [sys_code_1 + 4],al
mov [sys_data_1 + 4],al
mov [Real_code_1 + 4],al
mov [Real_data_1 + 4],al
mov [sys_code_1 + 7],ah
mov [sys_data_1 + 7],ah
mov [Real_code_1 + 7],ah
mov [Real_data_1 + 7],ah
add ebx,gdt ; EBX=linear address of gdt
mov [gdtr + 2],ebx
add ebx,idt - gdt ; EBX=linear address of idt
mov [idtr + 2],ebx
cli
mov ax,cs
mov [RealModeCS],ax
mov ax,0xB800
mov es,ax
lgdt [gdtr] ; VLoad the GDTR with the base address and limit of the GDT
lidt [idtr]
mov eax,cr0 ; Set the PE [protected mode enable] bit in register CR0
or al,1
mov cr0,eax
jmp sys_code:do_pm ; jumps to do_pm
;===============================================================================================;
; 32-bit protected mode
;===============================================================================================;
use32
do_pm:
xor edi,edi
xor esi,esi
mov ax,sys_data
mov ds,ax
mov es,ax
mov fs,ax
mov gs,ax
mov ss,ax
call remap_pic
call unmask_irqs
mov ax,linear_sel
mov es,ax
;===========================
cmp [ModeInfo_BitsPerPixel],24
jne bbd
add byte [bpp],1
bbd:
add [vesa_fontsmall_y],1
mov [color],0xffcccccc
call render_screen
MOV esi,testvchar
CALL print_vesa_string_small
MOV esi,testvchar
CALL print_vesa_string_small
MOV esi,testvchar
CALL print_vesa_string_small
MOV esi,testvchar
CALL print_vesa_string_small
MOV esi,testvchar
CALL print_vesa_string_small
MOV esi,testvchar
CALL print_vesa_string_small
nogo:
jmp nogo
;===============================================================================================;
; data
;===============================================================================================;
RealModeIP:
dw 0
RealModeCS:
dw 0
bpp dd 0
include 'A20.inc'
include 'pic.inc'
include 'msg.inc'
include 'Small_vesa_Text.inc'
include 'fonts.inc'
include 'TextMode.inc'
include 'keyboard.inc'
include 'keymaps.inc'
include 'errors.inc'
include 'isr.asm'
include 'TimeDate.inc'
include 'vesa2_info.inc'
;===============================================================================================;
; global descriptor table (GDT)
;===============================================================================================;
gdtr: dw gdt_end - gdt - 1 ; GDT limit
dd gdt ; (GDT base gets set above)
include 'gdt.asm'
;===============================================================================================;
; interrupt descriptor table (IDT)
;===============================================================================================;
idtr: dw idt_end - idt - 1 ; IDT limit
dd idt
include 'idt.asm'
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -