• R/O
  • SSH
  • HTTPS

haribote: Commit


Commit MetaInfo

Revision202 (tree)
Time2010-03-06 11:23:35
Authortatsupc

Log Message

orbspace

Change Summary

Incremental Difference

--- haribote/trunk/orbspace/orbspace/main.c (revision 201)
+++ haribote/trunk/orbspace/orbspace/main.c (revision 202)
@@ -5,8 +5,17 @@
55 struct bootinfo *binfo = (struct bootinfo *) 0x0ff0;
66 int i;
77
8+ idt_init();
9+
810 for (i = 0; i < 1024 * 768; i++) {
911 binfo->vram[i] = 0xffffff;
1012 }
11- for(;;);
13+
14+ outb(PIC0_IMR, 0xf9);
15+ outb(PIC1_IMR, 0xff);
16+ sti();
17+
18+ for(;;) {
19+ hlt();
20+ }
1221 }
--- haribote/trunk/orbspace/orbspace/main.h (nonexistent)
+++ haribote/trunk/orbspace/orbspace/main.h (revision 202)
@@ -0,0 +1,29 @@
1+/* ipl.nas */
2+struct bootinfo {
3+ unsigned char leds, reserve[3];
4+ unsigned int *vram;
5+};
6+
7+/* asmfunc.nas */
8+void hlt(void);
9+void cli(void);
10+void sti(void);
11+void outb(unsigned int port, unsigned int data);
12+void lidt(unsigned int limit, unsigned int addr);
13+void inthandler21(void);
14+
15+/* orbfs.c */
16+#include "orbfs.h"
17+
18+/* int.c */
19+struct gatedesc {
20+ unsigned short offset_low, sel;
21+ unsigned char dw_count, ar;
22+ unsigned short offset_high;
23+};
24+#define IDT_ADDR 0x00100000
25+#define IDT_LIMIT 0x000007ff
26+#define AR_INTGATE32 0x008e
27+#define PIC0_IMR 0x0021
28+#define PIC1_IMR 0x00a1
29+void idt_init(void);
--- haribote/trunk/orbspace/orbspace/int.c (nonexistent)
+++ haribote/trunk/orbspace/orbspace/int.c (revision 202)
@@ -0,0 +1,38 @@
1+#include "main.h"
2+
3+void gatedesc_set(struct gatedesc *gd, unsigned int offset, unsigned int sel,
4+ unsigned int ar)
5+{
6+ gd->offset_low = offset & 0xffff;
7+ gd->sel = sel;
8+ gd->dw_count = (ar >> 8) & 0xff;
9+ gd->ar = ar & 0xff;
10+ gd->offset_high = (offset >> 16) & 0xffff;
11+ return;
12+}
13+
14+void idt_init(void)
15+{
16+ struct gatedesc *idt = (struct gatedesc *) IDT_ADDR;
17+ int i;
18+
19+ for (i = 0; i <= IDT_LIMIT / 8; i++) {
20+ gatedesc_set(idt + i, 0, 0, 0);
21+ }
22+ gatedesc_set(idt + 0x21, (unsigned int) inthandler21, 2 * 8, AR_INTGATE32);
23+ lidt(IDT_LIMIT, IDT_ADDR);
24+ return;
25+}
26+
27+void keyhandler(int *esp)
28+{
29+ struct bootinfo *binfo = (struct bootinfo *) 0x0ff0;
30+ int i;
31+
32+ for (i = 0; i < 1024 * 768; i++) {
33+ binfo->vram[i] = 0;
34+ }
35+ for(;;) {
36+ hlt();
37+ }
38+}
--- haribote/trunk/orbspace/orbspace/Makefile (revision 201)
+++ haribote/trunk/orbspace/orbspace/Makefile (revision 202)
@@ -1,4 +1,4 @@
1-OBJS = main.obj orbfs.obj int.obj
1+OBJS = main.obj asmfunc.obj orbfs.obj int.obj
22 HEADERS = main.h orbfs.h
33
44 TOOLPATH = ../../z_tools/
@@ -41,6 +41,7 @@
4141 del ipl.bin
4242 del *.lst
4343 del *.obj
44+ del *.gas
4445 del *.map
45- del *.map
46+ del orbspace.bim
4647 del orbspace.sys
Show on old repository browser