luxos/main.c

65 lines
2.1 KiB
C

#include <system.h>
#include <console.h>
#include "gdt.c"
#include "idt.c"
#include "isrs.c"
#include "irq.c"
#include "timer.c"
#include "keyus.c"
#include "init.c"
/*void put_line_scroll(int line, char c)
{
int i = 0;
while (TextVideoRam[2*(80*line+i)] != 0 && i<=80) ++i;
if (i>78) {
memcpy(TextVideoRam + (2*80*line), TextVideoRam + (2*80*line) + 2, (i+1)*2);
}
putc_pos(i, line, c);
}*/
int main()
{
system_init();
set_default_colors (0x07, 0x04);
clrscr();
int i;
for (i=0;i<80;i++) putc_pos_font (i, 0, ' ', 0x02, 0x0F);
puts_pos_font (60, 0, "Uptime:", 0x02, 0x0E); cursor_y++;
// Do other stuff
puts ("Testing puts...\nAnd this shoudl be new line\n");
puts_font ("And this should be colored in another color ", 0x02, 0x0F);
puts ("<- colored font should be right about heree");
puts_pos (0, 23, "This text should be starting in position (0, 23)");
puts_pos_font (0, 23, "THIS", 0x00, 0x09);
puts_pos (5, 20, "<- The cursor should be blinking right here");
putc_pos_font (3, 20, 0, 0x04, 0x0F);
text_mode_cursor(3, 20);
while (1) {
kb_get_status();
put_bin(60, 15, kb_modifier_status);
puts_pos_font (60, 16, "LShift", 0x07, 0x08 - (kb_modifier_status&1)*0x06);
puts_pos_font (60, 17, "RShift", 0x07, 0x08 - (kb_modifier_status&2)*0x06);
puts_pos_font (60, 18, "LAlt", 0x07, 0x08 - (kb_modifier_status&4)*0x06);
puts_pos_font (60, 19, "RAlt", 0x07, 0x08 - (kb_modifier_status&8)*0x06);
puts_pos_font (60, 20, "LCtrl", 0x07, 0x08 - (kb_modifier_status&16)*0x06);
puts_pos_font (60, 21, "RCtrl", 0x07, 0x08 - (kb_modifier_status&32)*0x06);
puts_pos_font (60, 22, "FakeShift", 0x07, 0x08 - (kb_modifier_status&64)*0x06);
puts_pos_font (60, 23, "Special", 0x07, 0x08 - (kb_modifier_status&128)*0x06);
putc (kb_getch());
}
// do nothing
for(;;);
return 0;
}