Making console.c
console.c:718: error: static declaration of ‘sysbeep’ follows non-static declaration
console.c:54: error: previous declaration of ‘sysbeep’ was here
make[1]: *** [../../obj/console.o] Error 1
make[1]: Leaving directory `/work/src/fairysky0.01/drivers/char'
make: *** [lib/char.a] Error 2
[root@localhost fairysky0.01]# ack sysbeep
drivers/char/console.c
54:extern void sysbeep(void);
563: sysbeep();
717:static void sysbeep(void)
728: timer_table[BEEP_TIMER].fn = sysbeepstop;
[ORG 0x90000]
mov ax, SETUP_SEG
mov ds, ax
mov es, ax
mov si, boot_msg
call print_msg
mov ax, 0x0000;
mov ds, ax
mov es, ax
錯(cuò)誤在于:
00090020: ( ): int 0x15 ; cd15
00090022: ( ): add ax, 0x0400 ; 050004 >> ax = 0
00090025: ( ): shr ax, 0x02 ; c1e802
00090028: ( ): shr ax, 0x0a ; c1e80a
你使用了 int 0x15 來進(jìn)行獲取 memory size, 它返回 memory 放在 ax,加上 0x400 是什么意思?
回復(fù) Godbach
就是因?yàn)榧恿?0x400 導(dǎo)致 ax 溢出被清 0
結(jié)果無論多少內(nèi)存,都視為 0
應(yīng) ...
mik 發(fā)表于 2010-03-28 21:15
歡迎光臨 Chinaunix (http://72891.cn/) | Powered by Discuz! X3.2 |