mirror of
https://github.com/yourtion/30dayMakeOS.git
synced 2026-02-03 01:53:24 +08:00
不随操作系统版本而改变的API
This commit is contained in:
@@ -27,6 +27,7 @@ void init_gdtidt(void)
|
||||
set_gatedesc(idt + 0x21, (int) asm_inthandler21, 2 * 8, AR_INTGATE32);
|
||||
set_gatedesc(idt + 0x27, (int) asm_inthandler27, 2 * 8, AR_INTGATE32);
|
||||
set_gatedesc(idt + 0x2c, (int) asm_inthandler2c, 2 * 8, AR_INTGATE32);
|
||||
set_gatedesc(idt + 0x40, (int) asm_cons_putchar, 2 * 8, AR_INTGATE32);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
[BITS 32]
|
||||
MOV AL,'h'
|
||||
CALL 2*8:0xbe8
|
||||
INT 0x40
|
||||
MOV AL,'e'
|
||||
CALL 2*8:0xbe8
|
||||
INT 0x40
|
||||
MOV AL,'l'
|
||||
CALL 2*8:0xbe8
|
||||
INT 0x40
|
||||
MOV AL,'l'
|
||||
CALL 2*8:0xbe8
|
||||
INT 0x40
|
||||
MOV AL,'o'
|
||||
CALL 2*8:0xbe8
|
||||
INT 0x40
|
||||
RETF
|
||||
|
||||
@@ -218,10 +218,11 @@ _farcall: ; void farcall(int eip, int cs);
|
||||
RET
|
||||
|
||||
_asm_cons_putchar:
|
||||
STI
|
||||
PUSH 1
|
||||
AND EAX,0xff ; 将AH和EAX的高位置0,将EAX置为已存入字符编码的状态
|
||||
PUSH EAX
|
||||
PUSH DWORD [0x0fec] ; 读取内存并PUSH该值
|
||||
CALL _cons_putchar
|
||||
ADD ESP,12 ; 将栈中的数据丢弃
|
||||
RETF
|
||||
IRETD
|
||||
|
||||
Reference in New Issue
Block a user