• R/O
  • SSH
  • HTTPS

chnosproject: Commit


Commit MetaInfo

Revisión69 (tree)
Tiempo2010-03-13 16:15:36
Autorhikarupsp

Log Message

memory 表示。(警告が出るのはなぜだろう?)
memory.c追加。

Cambiar Resumen

Diferencia incremental

--- beta/tolset_chn_000/chnos_006/bootpack.c (revision 68)
+++ beta/tolset_chn_000/chnos_006/bootpack.c (revision 69)
@@ -7,11 +7,11 @@
77 struct VESAINFO *vinfo = (struct VESAINFO *) ADR_VESAINFO;
88 struct FIFO32 sysfifo;
99 struct MOUSE_DECODE mdec;
10- int fifobuf[256], i,time_tick,mx = binfo->scrnx / 2, my = binfo->scrny / 2;
10+ int fifobuf[256], i = 0,time_tick,mx = binfo->scrnx / 2, my = binfo->scrny / 2;
11+ unsigned int all_mem_size = memtest(0x00400000, 0xbffffffff);
1112 init_gdtidt();
1213 init_pic();
1314 init_pit(&time_tick);
14- i = 0;
1515
1616 io_sti();
1717
@@ -21,6 +21,12 @@
2121 init_mouse(&sysfifo, SYSFIFO_MOUSE, &mdec);
2222 pit_beep_off();
2323
24+ sprintf(s,"memory %d Byte(%d KB,%d MB)",all_mem_size,all_mem_size/1024, all_mem_size/(1024*1024));
25+ boxfill_i(vinfo->PhysBasePtr, binfo->scrnx, 0x000000, 0,304,300,320);
26+ putfonts_asc_i(vinfo->PhysBasePtr, binfo->scrnx, 0,304,0xffffff,s);
27+
28+
29+
2430 for (;;){
2531 io_cli();
2632 if(fifo32_status(&sysfifo) == 0) {
@@ -55,8 +61,8 @@
5561 my += mdec.y;
5662 if(mx < 0) mx = 0;
5763 if(my < 0) my = 0;
58- if(mx > binfo->scrnx - 32) mx = binfo->scrnx - 32;
59- if(my > binfo->scrny - 32) my = binfo->scrny - 32;
64+ if(mx > binfo->scrnx - 24) mx = binfo->scrnx - 24;
65+ if(my > binfo->scrny - 24) my = binfo->scrny - 24;
6066
6167 draw_mouse_i(vinfo->PhysBasePtr, mx, my, binfo->scrnx);
6268 boxfill_i(vinfo->PhysBasePtr, binfo->scrnx, 0x000000, 0,288,300,304);
--- beta/tolset_chn_000/chnos_006/memory.c (nonexistent)
+++ beta/tolset_chn_000/chnos_006/memory.c (revision 69)
@@ -0,0 +1,30 @@
1+#include "core.h"
2+
3+
4+unsigned int memtest(unsigned int start, unsigned int end)
5+{
6+
7+ char flg486 = 0;
8+ unsigned int eflg,cr0,i;
9+
10+ eflg = io_load_eflags();
11+ eflg |= EFLAGS_AC_BIT;
12+ io_store_eflags(eflg);
13+ eflg = io_load_eflags();
14+ if((eflg & EFLAGS_AC_BIT) != 0) flg486 = 1;
15+ eflg &= ~EFLAGS_AC_BIT;
16+ io_store_eflags(eflg);
17+ if(flg486 != 0) {
18+ cr0 = load_cr0();
19+ cr0 |= CR0_CACHE_DISABLE;
20+ store_cr0(cr0);
21+ }
22+ i = memtest_sub(start, end);
23+ if(flg486 != 0) {
24+ cr0 = load_cr0();
25+ cr0 &= ~CR0_CACHE_DISABLE;
26+ store_cr0(cr0);
27+ }
28+ return i;
29+
30+}
--- beta/tolset_chn_000/chnos_006/Makefile (revision 68)
+++ beta/tolset_chn_000/chnos_006/Makefile (revision 69)
@@ -1,4 +1,4 @@
1-OBJS_BOOTPACK = naskfunc.obj hankaku.obj graphic.obj gdtidt.obj int.obj io.obj fifo.obj keyboard.obj timer.obj mouse.obj bootpack.obj
1+OBJS_BOOTPACK = naskfunc.obj hankaku.obj graphic.obj gdtidt.obj int.obj io.obj fifo.obj keyboard.obj timer.obj mouse.obj memory.obj bootpack.obj
22
33 TOOLPATH = ../z_tools/
44 INCPATH = ../z_tools/CHNOSProject/
--- beta/tolset_chn_000/chnos_006/core.h (revision 68)
+++ beta/tolset_chn_000/chnos_006/core.h (revision 69)
@@ -85,42 +85,45 @@
8585 #define ADR_GATE_DESC 0x0026f800
8686
8787 #define ADR_IDT 0x0026f800
88-#define LIMIT_IDT 0x000007ff
88+#define LIMIT_IDT 0x000007ff
8989 #define ADR_GDT 0x00270000
90-#define LIMIT_GDT 0x0000ffff
90+#define LIMIT_GDT 0x0000ffff
9191 #define ADR_BOTPAK 0x00280000
9292 #define LIMIT_BOTPAK 0x0007ffff
9393 #define AR_DATA32_RW 0x4092
9494 #define AR_CODE32_ER 0x409a
9595 #define AR_LDT 0x0082
96-#define AR_TSS32 0x0089
96+#define AR_TSS32 0x0089
9797 #define AR_INTGATE32 0x008e
9898
99-#define PIC0_ICW1 0x0020
99+#define PIC0_ICW1 0x0020
100100 #define PIC0_OCW2 0x0020
101-#define PIC0_IMR 0x0021
102-#define PIC0_ICW2 0x0021
103-#define PIC0_ICW3 0x0021
104-#define PIC0_ICW4 0x0021
105-#define PIC1_ICW1 0x00a0
101+#define PIC0_IMR 0x0021
102+#define PIC0_ICW2 0x0021
103+#define PIC0_ICW3 0x0021
104+#define PIC0_ICW4 0x0021
105+#define PIC1_ICW1 0x00a0
106106 #define PIC1_OCW2 0x00a0
107-#define PIC1_IMR 0x00a1
108-#define PIC1_ICW2 0x00a1
109-#define PIC1_ICW3 0x00a1
110-#define PIC1_ICW4 0x00a1
107+#define PIC1_IMR 0x00a1
108+#define PIC1_ICW2 0x00a1
109+#define PIC1_ICW3 0x00a1
110+#define PIC1_ICW4 0x00a1
111111
112-#define PIT_CTRL 0x0043
113-#define PIT_CNT0 0x0040
112+#define PIT_CTRL 0x0043
113+#define PIT_CNT0 0x0040
114114
115-#define KEYB_DATA 0x0060
115+#define KEYB_DATA 0x0060
116116 #define PORT_KEYSTA 0x0064
117117 #define KEYSTA_SEND_NOTREADY 0x02
118118 #define KEYCMD_WRITE_MODE 0x60
119-#define KBC_MODE 0x47
119+#define KBC_MODE 0x47
120120 #define PORT_KEYCMD 0x0064
121121 #define KEYCMD_SENDTO_MOUSE 0xd4
122122 #define MOUSECMD_ENABLE 0xf4
123123
124+#define EFLAGS_AC_BIT 0x00040000
125+#define CR0_CACHE_DISABLE 0x60000000
126+
124127 #define SYSFIFO_KEYB 0x100 /*256~511=keycode*/
125128 #define SYSFIFO_MOUSE 0x200 /*512~767=mouse*/
126129
@@ -166,6 +169,9 @@
166169
167170 void init_pic(void);
168171
172+/*memory.c メモリ管理関係*/
173+unsigned int memtest(unsigned int start, unsigned int end);
174+
169175 /*keyboard.c キーボード関係*/
170176 void init_keyboard(struct FIFO32 *fifo, int data0);
171177 void inthandler21(int *esp);
Show on old repository browser