不随操作系统版本而改变的API

This commit is contained in:
Yourtion
2016-05-03 11:47:17 +08:00
parent 984b2886d0
commit ff3319e083
3 changed files with 8 additions and 6 deletions

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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