3 * Copyright (C) 2007 Tomas 'ZeXx86' Jedrzejek (zexx86@gmail.com)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 void sys_exit (struct regs
*r
)
28 printf ("exit (%u)\n", r
->ebx
);
31 extern int csr_x
, csr_y
;
32 extern void scroll (void);
33 extern void move_csr (void);
34 void sys_gotoxy (struct regs
*r
)
43 extern unsigned char scancode
;
44 void sys_getkey (struct regs
*r
)
46 unsigned att
= sattrib
<< 8;
47 unsigned short *where
;
48 unsigned char c
= (unsigned char) scancode
;
50 unsigned short *memptr
= (unsigned short *) 0x9000;
55 void sys_getch (struct regs
*r
)
57 // asm volatile ("movl %0, %%eax" :: "g" (key));
58 // asm volatile ("movl 'H', $0x");
59 unsigned att
= sattrib
<< 8;
60 unsigned short *where
;
64 c
= (unsigned char) key
;
69 unsigned short *memptr
= (unsigned short *) 0x9000;
75 void sys_sleep (struct regs
*r
)
77 timer_wait (r
->ebx
*18);
81 void sys_putch (struct regs
*r
)
86 void sys_color (struct regs
*r
)
88 settextcolor (r
->ebx
, r
->ecx
);
91 void sys_cls (struct regs
*r
)
96 void syscall_handler (struct regs
*r
)
125 /* In either case, we need to send an EOI to the master
126 * interrupt controller too */
127 outportb(0x20, 0x20);