攻克难题——字符串显示API

This commit is contained in:
Yourtion
2016-05-04 16:15:02 +08:00
parent d07ff5dd44
commit ae675195d4

View File

@@ -284,6 +284,7 @@ int cmd_app(struct CONSOLE *cons, int *fat, char *cmdline)
if (finfo != 0) {
/*找到文件的情况*/
p = (char *) memman_alloc_4k(memman, finfo->size);
*((int *) 0xfe8) = (int) p;
file_loadfile(finfo->clustno, finfo->size, p, fat, (char *) (ADR_DISKIMG + 0x003e00));
set_segmdesc(gdt + 1003, finfo->size - 1, (int) p, AR_CODE32_ER);
farcall(0, 1003 * 8);
@@ -297,13 +298,14 @@ int cmd_app(struct CONSOLE *cons, int *fat, char *cmdline)
void hrb_api(int edi, int esi, int ebp, int esp, int ebx, int edx, int ecx, int eax)
{
int cs_base = *((int *) 0xfe8);
struct CONSOLE *cons = (struct CONSOLE *) *((int *) 0x0fec);
if (edx == 1) {
cons_putchar(cons, eax & 0xff, 1);
} else if (edx == 2) {
cons_putstr0(cons, (char *) ebx);
cons_putstr0(cons, (char *) ebx + cs_base);
} else if (edx == 3) {
cons_putstr1(cons, (char *) ebx, ecx);
cons_putstr1(cons, (char *) ebx + cs_base, ecx);
}
return;
}