• R/O
  • SSH
  • HTTPS

chnosproject: コミット


コミットメタ情報

リビジョン319 (tree)
日時2012-04-05 09:14:43
作者hikarupsp

ログメッセージ

見た目上の変化はあまりない。
testsheetの透明色指定を解除した。
TaskControlMessageを追加した。画面解像度が変更されたときに通知する。
タスク管理を多少変更した。
マウスは初期化までは終わっている。
全てのエミュレーターで動作は確認したが、Bochsでは画面解像度変更後のマウスカーソルが正しく描画されていない。

変更サマリ

差分

--- beta/tolset_chn_000/chnos_010/chnos/coredef3.h (revision 318)
+++ beta/tolset_chn_000/chnos_010/chnos/coredef3.h (revision 319)
@@ -1,4 +1,8 @@
11
2-/*システムFIFOコマンド宣言*/
2+/*TaskControlMessage宣言*/
33
4-#define FIFOCMD_KBCT_SET_FOCUS_FIFO 0x80000001 //[CMD][DATA_FIFO32 *][offset][(FLAGS)][EOA]
4+//タスクに標準付属のFIFOに送信される、システムからの通知。
5+//0x80000000から始まる。=31ビット目がTrueかつタスクのFIFOであれば、TCMである。
6+//タスク実行リンク中にないタスクには送信されないが、スリープ中のタスクには送信される。
7+
8+#define TCM_INFO_DISPLAY_UPDATE_RESOLUTION 0x80000001
--- beta/tolset_chn_000/chnos_010/chnos/keyboard.c (revision 318)
+++ beta/tolset_chn_000/chnos_010/chnos/keyboard.c (revision 319)
@@ -177,7 +177,8 @@
177177 0x0000,
178178 KEYID_MASK_EXTENDED | KEYID_MUHENKAN,
179179 0x0000,
180- 0x5c, //\ for mikan-trap
180+ '\\',
181+// 0x5c, // ='\' for mikan-trap.
181182 0x0000,
182183 0x0000
183184 };
@@ -332,6 +333,12 @@
332333 state_keyctrl.keyctrl = 0;
333334 state_keyalt.keyalt = 0;
334335 key_decode_phase = 0;
336+
337+ KeyboardController_Wait_SendReady();
338+ IO_Out8(PORT_KEYCMD, KEYCMD_WRITE_8042_MODE_REG);
339+ KeyboardController_Wait_SendReady();
340+ IO_Out8(PORT_KEYDATA, KBC_MODE);
341+
335342 return;
336343 }
337344
@@ -369,10 +376,15 @@
369376 keyid = 0;
370377 table = 0;
371378
379+ if(keycode == KEYDATA_ACK || keycode == KEYDATA_RESEND){
380+ return 0;
381+ }
382+
372383 key_decode_buf[key_decode_phase] = keycode;
373384
374385 switch(key_decode_phase){
375386 case 0:
387+
376388 if(key_decode_buf[0] == 0xe0){
377389 key_decode_phase = 1;
378390 break;
--- beta/tolset_chn_000/chnos_010/chnos/display.c (revision 318)
+++ beta/tolset_chn_000/chnos_010/chnos/display.c (revision 319)
@@ -43,10 +43,12 @@
4343 ctrl->vram = VGA_VRAM_ADR;
4444
4545 Drawing08_Initialise_Palette();
46+ Initialise_Drawing();
4647 Error_Set_Enable_Display_TextMode(False);
4748 Error_Set_Enable_Display_GraphicMode(True, ctrl->vram, ctrl->xsize, ctrl->ysize >> 4);
49+ ctrl->vramsheet = Sheet_Initialise();
50+ Sheet_SetBuffer(ctrl->vramsheet, ctrl->vram, ctrl->xsize, ctrl->ysize, ctrl->bpp);
4851
49-
5052 //次に、VBEのBIOS情報を得る。
5153
5254 callbiosctrl->CallBIOS_Task->tss->eax = 0x4f00;
@@ -269,6 +271,8 @@
269271 #endif
270272 Initialise_Drawing();
271273 Error_Set_Enable_Display_GraphicMode(True, ctrl->vram, ctrl->xsize, ctrl->ysize >> 4);
274+ Sheet_SetBuffer(ctrl->vramsheet, ctrl->vram, ctrl->xsize, ctrl->ysize, ctrl->bpp);
275+ System_TaskControlMessage_Send_AllTask(TCM_INFO_DISPLAY_UPDATE_RESOLUTION);
272276 return 0;
273277 }
274278
--- beta/tolset_chn_000/chnos_010/chnos/shtfunc.c (revision 318)
+++ beta/tolset_chn_000/chnos_010/chnos/shtfunc.c (revision 319)
@@ -145,10 +145,20 @@
145145 }
146146
147147 if(force){
148- for(y = p.y; y <= r.y; y++){
149- for(x = p.x; x <= r.x; x++){
150- sheet->parent->map[y * sheet->parent->size.x + x] = (uint)sheet;
148+ if(sheet->flags.bit.using_invcol){
149+ for(y = p.y; y <= r.y; y++){
150+ for(x = p.x; x <= r.x; x++){
151+ if(sheet->IsVisiblePixel(sheet, x, y)){
152+ sheet->parent->map[y * sheet->parent->size.x + x] = (uint)sheet;
153+ }
154+ }
151155 }
156+ } else{
157+ for(y = p.y; y <= r.y; y++){
158+ for(x = p.x; x <= r.x; x++){
159+ sheet->parent->map[y * sheet->parent->size.x + x] = (uint)sheet;
160+ }
161+ }
152162 }
153163 } else{
154164 if(sheet->flags.bit.using_invcol){
--- beta/tolset_chn_000/chnos_010/chnos/mtask.c (revision 318)
+++ beta/tolset_chn_000/chnos_010/chnos/mtask.c (revision 319)
@@ -2,6 +2,7 @@
22 #include "core.h"
33
44 //FIFOによるタスクの自動起動は既定で有効ですが、タスクが明示的に実行されるまでは無効になっています。
5+//タスクはSTI下で開始されます(外部割り込み有効)。
56
67 UI_TaskControl *Initialise_MultiTask_Control(IO_MemoryControl sysmemctrl)
78 {
@@ -20,6 +21,7 @@
2021 ctrl->now = maintask;
2122
2223 maintask->flags.linked = True;
24+ maintask->flags.running = True;
2325 maintask->flags.first_run = False;
2426 FIFO32_Set_Task(maintask->fifo, maintask);
2527
@@ -92,10 +94,63 @@
9294 return task;
9395 }
9496
95-void MultiTask_Task_Run(UI_TaskControl *ctrl, UI_Task *task)
97+uint MultiTask_Internal_Task_SetLink(UI_TaskControl *ctrl, UI_Task *task)
9698 {
9799 UI_Task **last;
100+ uint eflags;
98101
102+ eflags = IO_Load_EFlags();
103+ IO_CLI();
104+
105+ for(last = &ctrl->start; *last != Null; last = &(*last)->next){
106+ if(*last == task){
107+ #ifdef CHNOSPROJECT_DEBUG_MULTITASK
108+ debug("MultiTask_Internal_Task_SetLink:Task has already been linked(sel:0x%X).\n", task->selector);
109+ #endif
110+ return 1;
111+ }
112+ }
113+ task->next = Null;
114+ *last = task;
115+ task->flags.linked = True;
116+
117+ IO_Store_EFlags(eflags);
118+
119+ return 0;
120+}
121+
122+uint MultiTask_Internal_Task_ClearLink(UI_TaskControl *ctrl, UI_Task *task)
123+{
124+ UI_Task **find;
125+ uint eflags;
126+
127+ eflags = IO_Load_EFlags();
128+ IO_CLI();
129+
130+ for(find = &ctrl->start; *find != task; find = &(*find)->next){
131+ if(*find == Null){
132+ #ifdef CHNOSPROJECT_DEBUG_MULTITASK
133+ debug("MultiTask_Internal_Task_ClearLink:Task not found(sel:0x%X).\n", task->selector);
134+ #endif
135+ return 1;
136+ }
137+ }
138+ *find = task->next;
139+ task->next = Null;
140+ task->flags.linked = False;
141+ task->flags.running = False;
142+
143+ if(ctrl->now == task){
144+ MultiTask_TaskSwitch(ctrl);
145+ }
146+
147+ IO_Store_EFlags(eflags);
148+
149+ return 0;
150+}
151+
152+void MultiTask_Task_Run(UI_TaskControl *ctrl, UI_Task *task)
153+{
99154 #ifdef CHNOSPROJECT_DEBUG_CALLLINK
100155 debug("MultiTask_Task_Run:Called from[0x%08X].\n", *((uint *)(&ctrl - 1)));
101156 #endif
@@ -104,7 +159,7 @@
104159 debug("MultiTask_Task_Run:Start Running Rq(sel:0x%X).\n", task->selector);
105160 #endif
106161
107- if(task->flags.linked){
162+ if(task->flags.running){
108163 #ifdef CHNOSPROJECT_DEBUG_MULTITASK
109164 debug("MultiTask_Task_Run:Task has already been running(sel:0x%X).\n", task->selector);
110165 #endif
@@ -111,18 +166,12 @@
111166 return;
112167 }
113168
114- for(last = &ctrl->start; ; last = &(*last)->next){
115- if(*last == task){
116- #ifdef CHNOSPROJECT_DEBUG_MULTITASK
117- debug("MultiTask_Task_Run:Task has already been running2(sel:0x%X).\n", task->selector);
118- #endif
119- return;
120- }
121- if(*last == Null){
122- break;
123- }
169+ if(!task->flags.linked){
170+ MultiTask_Internal_Task_SetLink(ctrl, task);
124171 }
125172
173+ task->flags.running = True;
174+
126175 #ifdef CHNOSPROJECT_DEBUG_MULTITASK
127176 debug("MultiTask_Task_Run:Start Running(sel:0x%X last:0x%X start:0x%X).\n", task->selector, last, ctrl->start);
128177 #endif
@@ -135,36 +184,44 @@
135184 task->flags.first_run = False;
136185 }
137186
138- task->next = Null;
139- *last = task;
140- task->flags.linked = True;
141-
142187 return;
143188 }
144189
145190 void MultiTask_TaskSwitch(UI_TaskControl *ctrl)
146191 {
147- if(ctrl->now->next == Null){ //タスクリンクの終端
148- if(ctrl->start != ctrl->now){ //同一タスクでなければタスクスイッチ
149- ctrl->now = ctrl->start;
192+ UI_Task *nexttask;
193+ uint eflags;
194+
195+ eflags = IO_Load_EFlags();
196+ IO_CLI();
197+
198+ for(nexttask = ctrl->now->next; ; nexttask = nexttask->next){
199+ if(nexttask == Null){ //リンク終端に来たら先頭へ巻き戻す
200+ nexttask = ctrl->start;
201+ }
202+ if(nexttask == ctrl->now){ //実行中状態のタスクは現在実行中のこのタスクしかないのでタスクスイッチなし
203+ return;
204+ }
205+ if(nexttask->flags.running){ //実行中状態のほかのタスクが見つかったのでタスクスイッチ
206+ ctrl->now = nexttask;
150207 ctrl->now->count++;
151208 FarJMP(0, ctrl->now->selector << 3);
209+ break;
152210 }
153- } else{
154- ctrl->now = ctrl->now->next;
155- ctrl->now->count++;
156- FarJMP(0, ctrl->now->selector << 3);
157211 }
212+
213+ IO_Store_EFlags(eflags);
214+
158215 return;
159216 }
160217
161218 void MultiTask_Task_Sleep(UI_TaskControl *ctrl, UI_Task *task)
162219 {
163- UI_Task **find;
220+ //CPL=0下を想定
164221
165222 uint eflags;
166223
167- if(task == ctrl->now && task == ctrl->start){
224+ if(task == ctrl->now && task == ctrl->start){ //自分が唯一無二のタスクだった場合、スリープは実行できないのでHLTする
168225 eflags = IO_Load_EFlags();
169226 IO_STIHLT();
170227 IO_Store_EFlags(eflags);
@@ -171,37 +228,40 @@
171228 return;
172229 }
173230
174- for(find = &ctrl->start; (*find) != Null; find = &(*find)->next){
175- if(*find == task){ /*タスク実行リンクからみつけたら*/
176- break;
177- }
231+ task->flags.running = False;
232+
233+ if(ctrl->now == task){
234+ MultiTask_TaskSwitch(ctrl);
178235 }
179- if((*find) == 0){ /*見つけたのでなく、終端だったら*/
236+
237+ return;
238+}
239+
240+void MultiTask_Task_Kill(UI_TaskControl *ctrl, UI_Task *task)
241+{
242+ //CPL=0下を想定
243+
244+ if(task == ctrl->now && task == ctrl->start){ //自分が唯一無二のタスクだった場合、killはOS自体の終了を意味するので、アボート
180245 #ifdef CHNOSPROJECT_DEBUG_MULTITASK
181- debug("MultiTask_Task_Sleep:Task sleep Failed(sel:0x%X).\n", task->selector);
246+ debug("MultiTask_Task_Stop:Attempted to stop last task. Abort.\n");
182247 #endif
248+ INT_3();
183249 return;
184250 }
185251
186- #ifdef CHNOSPROJECT_DEBUG_MULTITASK
187- debug("MultiTask_Task_Sleep:Task sleep (sel:0x%X).\n", task->selector);
188- #endif
252+ MultiTask_Internal_Task_ClearLink(ctrl, task);
189253
190- eflags = IO_Load_EFlags();
191- IO_CLI();
192-
193- *find = task->next;
194- task->flags.linked = False;
195-
196- if(ctrl->now == task){
197- MultiTask_TaskSwitch(ctrl);
254+ return;
255+}
256+/*
257+void MultiTask_Task_Free(UI_TaskControl *ctrl, UI_Task *task)
258+{
259+ if(task->flags.linked){
260+ MultiTask_Task_Kill(ctrl, task);
198261 }
199262
200- IO_Store_EFlags(eflags);
201-
202- return;
203263 }
204-
264+*/
205265 UI_Task *MultiTask_GetNowTask(UI_TaskControl *ctrl)
206266 {
207267 return ctrl->now;
--- beta/tolset_chn_000/chnos_010/chnos/intrpt.c (revision 318)
+++ beta/tolset_chn_000/chnos_010/chnos/intrpt.c (revision 319)
@@ -51,6 +51,7 @@
5151 } else{ /*For Slave*/
5252 irq -= 8;
5353 IO_Out8(PIC1_IMR, IO_In8(PIC1_IMR) & ~(mask << irq));
54+ IO_Out8(PIC0_IMR, IO_In8(PIC0_IMR) & ~(mask << 2));
5455 }
5556
5657 return;
@@ -64,10 +65,10 @@
6465
6566 if(irq < 8){ /*For Master*/
6667 IO_Out8(PIC0_OCW2, 0x60 + irq);
67- } else{ /*For Slave*/
68- IO_Out8(PIC0_OCW2, 0x60 + 0x02);
68+ } else{ /*For Slave (and Master IRQ2)*/
6969 irq -= 8;
7070 IO_Out8(PIC1_OCW2, 0x60 + irq);
71+ IO_Out8(PIC0_OCW2, 0x60 + 0x02);
7172 }
7273 return;
7374 }
--- beta/tolset_chn_000/chnos_010/chnos/system.c (revision 318)
+++ beta/tolset_chn_000/chnos_010/chnos/system.c (revision 319)
@@ -81,12 +81,17 @@
8181
8282 typedef struct SYSTEM_COMMONDATA {
8383 uint RunningPhase;
84- uint PhysicalMemorySize;
85- IO_MemoryControl MemoryController;
86- UI_TaskControl *TaskController;
87- IO_CallBIOSControl *CallBIOSController;
88- IO_DisplayControl *DisplayController;
84+ DATA_FIFO32 *InputFocus;
85+ struct SYSTEM_COMMONDATA_CONTROLLER {
86+ IO_MemoryControl Memory;
87+ UI_TaskControl *Task;
88+ IO_CallBIOSControl *CallBIOS;
89+ IO_DisplayControl *Display;
90+ } Controller;
8991 struct SYSTEM_COMMONDATA_ENVIRONMENT {
92+ struct SYSTEM_COMMONDATA_ENVIRONMENT_MEMORY {
93+ uint PhysicalSize;
94+ } Memory;
9095 struct SYSTEM_COMMONDATA_ENVIRONMENT_CPUID {
9196 uint max_id;
9297 uint max_eid;
@@ -93,6 +98,11 @@
9398 CPUID_FunctionFlags function_flags;
9499 } CPUID;
95100 } Environment;
101+ struct SYSTEM_COMMONDATA_CORETASK {
102+ UI_Task *Main;
103+ UI_Task *KeyboardControl;
104+ UI_Task *MouseControl;
105+ } CoreTask;
96106 } System_CommonData;
97107 //
98108 System_CommonData System;
@@ -140,9 +150,9 @@
140150 i = System_Get_PhisycalMemorySize();
141151 snprintf(s, sizeof(s), "\tMemory:%uByte %uKiB %uMib\n", i, i >> 10, i >> 20);
142152 TextMode_Put_String(s, white);
143- System.MemoryController = Memory_Initialise_Control((void *)PHYSICAL_MEMORY_ALLOCATION_START_ADDRESS, i - PHYSICAL_MEMORY_ALLOCATION_START_ADDRESS, SYSTEM_MEMORY_CONTROL_TAGS);
153+ System.Controller.Memory = Memory_Initialise_Control((void *)PHYSICAL_MEMORY_ALLOCATION_START_ADDRESS, i - PHYSICAL_MEMORY_ALLOCATION_START_ADDRESS, SYSTEM_MEMORY_CONTROL_TAGS);
144154
145- i = Memory_Get_FreeSize(System.MemoryController);
155+ i = Memory_Get_FreeSize(System.Controller.Memory);
146156 snprintf(s, sizeof(s), "\tFreeMemory:%uByte %uKiB %uMib\n", i, i >> 10, i >> 20);
147157 TextMode_Put_String(s, white);
148158
@@ -162,11 +172,13 @@
162172 Initialise_Keyboard();
163173
164174 TextMode_Put_String("\tInitialising MultiTask...\n", white);
165- System.TaskController = Initialise_MultiTask_Control(System.MemoryController);
175+ System.Controller.Task = Initialise_MultiTask_Control(System.Controller.Memory);
166176 Timer_Set_TaskSwitch(&System_TaskSwitch);
177+ System.CoreTask.Main = System_MultiTask_GetNowTask();
178+ System.InputFocus = System.CoreTask.Main->fifo;
167179
168180 TextMode_Put_String("\tInitialising CallBIOS...\n", white);
169- System.CallBIOSController = Initialise_CallBIOS();
181+ System.Controller.CallBIOS = Initialise_CallBIOS();
170182
171183 TextMode_Put_String("\tReading CPU Identification...\n", white);
172184 eflags.eflags = IO_Load_EFlags();
@@ -219,8 +231,28 @@
219231
220232 IO_STI();
221233
222- System.DisplayController = Initialise_Display();
234+ System.Controller.Display = Initialise_Display();
223235
236+//Core Task Run.
237+
238+ System.CoreTask.KeyboardControl = System_MultiTask_Task_Initialise(0);
239+ System.CoreTask.KeyboardControl->tss->eip = (uint)&KeyboardControlTask;
240+ System.CoreTask.KeyboardControl->tss->cs = SYSTEM_CS << 3;
241+ System.CoreTask.KeyboardControl->tss->ss = SYSTEM_DS << 3;
242+ System.CoreTask.KeyboardControl->tss->ds = SYSTEM_DS << 3;
243+ System.CoreTask.KeyboardControl->tss->esp = (uint)System_Memory_Allocate(1024 * 32) + (1024 * 32);
244+ MultiTask_Push_Arguments(System.CoreTask.KeyboardControl, 1, &System.InputFocus);
245+ System_MultiTask_Task_Run(System.CoreTask.KeyboardControl);
246+
247+ System.CoreTask.MouseControl = System_MultiTask_Task_Initialise(0);
248+ System.CoreTask.MouseControl->tss->eip = (uint)&MouseControlTask;
249+ System.CoreTask.MouseControl->tss->cs = SYSTEM_CS << 3;
250+ System.CoreTask.MouseControl->tss->ss = SYSTEM_DS << 3;
251+ System.CoreTask.MouseControl->tss->ds = SYSTEM_DS << 3;
252+ System.CoreTask.MouseControl->tss->esp = (uint)System_Memory_Allocate(1024 * 32) + (1024 * 32);
253+ MultiTask_Push_Arguments(System.CoreTask.MouseControl, 2, &System.InputFocus, MouseCursor_Initialise(System.Controller.Display->vramsheet));
254+ System_MultiTask_Task_Run(System.CoreTask.MouseControl);
255+
224256 return;
225257 }
226258
@@ -241,7 +273,7 @@
241273
242274 uint System_Get_PhisycalMemorySize(void)
243275 {
244- return System.PhysicalMemorySize;
276+ return System.Environment.Memory.PhysicalSize;
245277 }
246278
247279 void System_SegmentDescriptor_Set_Absolute(uint selector, uint limit, uint base, uint ar)
@@ -305,9 +337,6 @@
305337 }
306338
307339 Error_Report(ERROR_NO_MORE_SEGMENT, *retaddr);
308- for(;;){
309- IO_HLT();
310- }
311340
312341 return 0;
313342 }
@@ -323,13 +352,13 @@
323352
324353 void System_TaskSwitch(void)
325354 {
326- MultiTask_TaskSwitch(System.TaskController);
355+ MultiTask_TaskSwitch(System.Controller.Task);
327356 return;
328357 }
329358
330359 UI_Task *System_MultiTask_Task_Initialise(uint tss_additional_size)
331360 {
332- return MultiTask_Task_Initialise(System.TaskController, tss_additional_size);
361+ return MultiTask_Task_Initialise(System.Controller.Task, tss_additional_size);
333362 }
334363
335364 void System_MultiTask_Task_Run(UI_Task *task)
@@ -337,73 +366,95 @@
337366 #ifdef CHNOSPROJECT_DEBUG_CALLLINK
338367 debug("System_MultiTask_Task_Run:Called from[0x%08X].\n", *((uint *)(&task - 1)));
339368 #endif
340- MultiTask_Task_Run(System.TaskController, task);
369+ MultiTask_Task_Run(System.Controller.Task, task);
341370 return;
342371 }
343372
344373 void *System_Memory_Allocate(uint size)
345374 {
346- return Memory_Allocate(System.MemoryController, size);
375+ return Memory_Allocate(System.Controller.Memory, size);
347376 }
348377
349378 UI_Task *System_MultiTask_GetNowTask(void)
350379 {
351- return MultiTask_GetNowTask(System.TaskController);
380+ return MultiTask_GetNowTask(System.Controller.Task);
352381 }
353382
354383 IO_CallBIOSControl *System_CallBIOS_Get_Controller(void)
355384 {
356- return System.CallBIOSController;
385+ return System.Controller.CallBIOS;
357386 }
358387
359388 void System_CallBIOS_Execute(uchar intn, DATA_FIFO32 *fifo, uint endsignal)
360389 {
361- CallBIOS_Execute(System.CallBIOSController, intn, fifo, endsignal);
390+ CallBIOS_Execute(System.Controller.CallBIOS, intn, fifo, endsignal);
362391 return;
363392 }
364393
365394 void System_Memory_Free(void *addr, uint size)
366395 {
367- Memory_Free(System.MemoryController, addr, size);
396+ Memory_Free(System.Controller.Memory, addr, size);
368397 return;
369398 }
370399
371400 void System_CallBIOS_Send_End_Of_Operation(uint abort)
372401 {
373- CallBIOS_Send_End_Of_Operation(System.CallBIOSController, abort);
402+ CallBIOS_Send_End_Of_Operation(System.Controller.CallBIOS, abort);
374403 return;
375404 }
376405
377406 void System_MultiTask_Task_Sleep(UI_Task *task)
378407 {
379- MultiTask_Task_Sleep(System.TaskController, task);
408+ MultiTask_Task_Sleep(System.Controller.Task, task);
380409 return;
381410 }
382411
412+void System_MultiTask_Task_Kill(UI_Task *task)
413+{
414+ MultiTask_Task_Kill(System.Controller.Task, task);
415+ return;
416+}
417+
383418 DATA_FIFO32 *System_FIFO32_Initialise(uint size)
384419 {
385- return FIFO32_Initialise(System.MemoryController, size);
420+ return FIFO32_Initialise(System.Controller.Memory, size);
386421 }
387422
388423 uint System_Display_VESA_Set_VideoMode(uint index)
389424 {
390- return Display_VESA_Set_VideoMode(System.DisplayController, index);
425+ return Display_VESA_Set_VideoMode(System.Controller.Display, index);
391426 }
392427
393428 IO_DisplayControl *System_Display_Get_Controller(void)
394429 {
395- return System.DisplayController;
430+ return System.Controller.Display;
396431 }
397432
398433 uint System_Memory_Get_FreeSize(void)
399434 {
400- return Memory_Get_FreeSize(System.MemoryController);
435+ return Memory_Get_FreeSize(System.Controller.Memory);
401436 }
402437
438+uint System_TaskControlMessage_Send_AllTask(uint message)
439+{
440+ UI_Task *task;
441+ uint sended_tasks;
442+
443+ sended_tasks = 0;
444+ for(task = System.Controller.Task->start; task != Null; task = task->next){
445+ if(task->fifo != Null){
446+ sended_tasks++;
447+ FIFO32_Put(task->fifo, message);
448+ }
449+ }
450+
451+ return sended_tasks;
452+}
453+
403454 //
404455 void System_Check_Memory(void)
405456 {
406- System.PhysicalMemorySize = Memory_Test(0x00400000, 0xbfffffff);
457+ System.Environment.Memory.PhysicalSize = Memory_Test(0x00400000, 0xbfffffff);
407458 return;
408459 }
409460
--- beta/tolset_chn_000/chnos_010/chnos/debug.c (revision 318)
+++ beta/tolset_chn_000/chnos_010/chnos/debug.c (revision 319)
@@ -136,11 +136,14 @@
136136
137137 debug_exception_last_addr = esp[0x0a];
138138
139+//Microsot VirtualPC2007 Only
140+/*
139141 if(((uchar *)(SegmentDescriptor_Get_Base(&gdt[esp[0x0b] >> 3])))[esp[0x0a]] == 0x89){
140142 esp[0x0a] += 3;
141143 }
144+*/
142145
143-Debug_PhysicalMemoryDump((void *)Load_DR0(), 32);
146+Debug_PhysicalMemoryDump((void *)(Load_DR0() - 16), 32);
144147
145148 //Wait press any key.
146149 for(;;){
--- beta/tolset_chn_000/chnos_010/chnos/callbios.c (revision 318)
+++ beta/tolset_chn_000/chnos_010/chnos/callbios.c (revision 319)
@@ -34,6 +34,9 @@
3434 Store_CR4(cr4.cr4);
3535
3636 ctrl->CallBIOS_Task = System_MultiTask_Task_Initialise((256 >> 3) + (65536 >> 3) + 1);
37+//CallBIOS 16Bit エミュレーションタスクはFIFOを使用しないのでタスクのFIFOを解放
38+ FIFO32_Free(ctrl->CallBIOS_Task->fifo);
39+ ctrl->CallBIOS_Task->fifo = Null;
3740
3841 q = (uchar *)(ctrl->CallBIOS_Task->tss + sizeof(CPU_TaskStateSegment));
3942 for(i = 0; i < (256 >> 3); i++){
@@ -57,6 +60,7 @@
5760 return ctrl;
5861 }
5962
63+//fifoには、終了状況を受け取るfifoを指定する。endsignalは正常終了、endsignal+1は異常終了を示す。
6064 void CallBIOS_Execute(IO_CallBIOSControl *ctrl, uchar intn, DATA_FIFO32 *fifo, uint endsignal)
6165 {
6266 uchar *q;
@@ -95,7 +99,7 @@
9599
96100 void CallBIOS_Check_Privileged_Operation(uint *esp)
97101 {
98-//例外発生時に呼ばれることを想定
102+//エラーコードのある例外発生時に呼ばれることを想定
99103 //エラーコードのない例外からだと、スタックがずれるので注意
100104 uchar *eip;
101105 ushort *userstack;
@@ -174,7 +178,7 @@
174178 System_CallBIOS_Send_End_Of_Operation(True);
175179
176180 for(;;){
177- System_MultiTask_Task_Sleep(System_MultiTask_GetNowTask());
181+ System_MultiTask_Task_Kill(System_MultiTask_GetNowTask());
178182 }
179183
180184 return;
--- beta/tolset_chn_000/chnos_010/chnos/core.h (revision 318)
+++ beta/tolset_chn_000/chnos_010/chnos/core.h (revision 319)
@@ -3,11 +3,13 @@
33 #include "coredef0.h" /*システム定数宣言*/
44 #include "coredef1.h" /*システムデータ型宣言*/
55 #include "coredef2.h" /*システム外部リソース宣言*/
6-#include "coredef3.h" /*システムFIFOコマンド宣言*/
6+#include "coredef3.h" /*TaskControlMessage宣言*/
77 #include "keyid.h" /*KeyIdentifier キーID宣言*/
88
99 /*functions*/
1010 /*bootpack.c 基幹部分*/
11+void KeyboardControlTask(DATA_FIFO32 **InputFocus);
12+void MouseControlTask(DATA_FIFO32 **InputFocus, UI_MouseCursor *mcursor);
1113
1214 /*callbios.c 32bitからBIOSをコールするための関数群*/
1315
@@ -210,17 +212,23 @@
210212 uint Memory_Get_FreeSize(IO_MemoryControl ctrl);
211213
212214 /*mouse.c マウス関連*/
213-void Mouse_SendCommand(uint data);
215+void Initialise_Mouse(void);
216+void InterruptHandler2c(uint *esp);
217+void Mouse_SendCommand(uint cmd);
214218 UI_MouseCursor *MouseCursor_Initialise(UI_Sheet *parent);
215219 uint MouseCursor_Show(UI_MouseCursor *mcursor);
216-uint MouseCursor_Move_Relative(UI_MouseCursor *mcursor, int apx, int apy);
220+uint MouseCursor_Move_Relative(UI_MouseCursor *mcursor, int rpx, int rpy);
221+uint MouseCursor_Move_Absolute(UI_MouseCursor *mcursor, int apx, int apy);
217222
218223 /*mtask.c マルチタスク関連*/
219224 UI_TaskControl *Initialise_MultiTask_Control(IO_MemoryControl sysmemctrl);
220225 UI_Task *MultiTask_Task_Initialise(UI_TaskControl *ctrl, uint tss_additional_size);
226+uint MultiTask_Internal_Task_SetLink(UI_TaskControl *ctrl, UI_Task *task);
227+uint MultiTask_Internal_Task_CleartLink(UI_TaskControl *ctrl, UI_Task *task);
221228 void MultiTask_Task_Run(UI_TaskControl *ctrl, UI_Task *task);
222229 void MultiTask_TaskSwitch(UI_TaskControl *ctrl);
223230 void MultiTask_Task_Sleep(UI_TaskControl *ctrl, UI_Task *task);
231+void MultiTask_Task_Kill(UI_TaskControl *ctrl, UI_Task *task);
224232 UI_Task *MultiTask_GetNowTask(UI_TaskControl *ctrl);
225233 uint MultiTask_Push_Arguments(UI_Task *task, uint args, ...);
226234
@@ -328,10 +336,12 @@
328336 void System_Memory_Free(void *addr, uint size);
329337 void System_CallBIOS_Send_End_Of_Operation(uint abort);
330338 void System_MultiTask_Task_Sleep(UI_Task *task);
339+void System_MultiTask_Task_Kill(UI_Task *task);
331340 DATA_FIFO32 *System_FIFO32_Initialise(uint size);
332341 uint System_Display_VESA_Set_VideoMode(uint index);
333342 IO_DisplayControl *System_Display_Get_Controller(void);
334343 uint System_Memory_Get_FreeSize(void);
344+uint System_TaskControlMessage_Send_AllTask(uint message);
335345
336346 /*timer.c タイマー関連*/
337347 UI_TimerControl *Initialise_ProgrammableIntervalTimer(void);
@@ -486,6 +496,7 @@
486496 void asm_InterruptHandler20(void);
487497 void asm_InterruptHandler21(void);
488498 void asm_InterruptHandler27(void);
499+void asm_InterruptHandler2c(void);
489500
490501 /*nasfunc2.nas 16bitコード*/
491502 void asm_16bit_CallBIOSTask(void);
--- beta/tolset_chn_000/chnos_010/chnos/bootpack.c (revision 318)
+++ beta/tolset_chn_000/chnos_010/chnos/bootpack.c (revision 319)
@@ -1,16 +1,10 @@
11
22 #include "core.h"
33
4-#define MAIN_KEYBASE 0x100
5-
6-void KeyboardControlTask(void);
7-void MouseControlTask(UI_MouseCursor *mcursor);
8-
94 void CHNMain(void)
105 {
116 uchar s[128];
127 uint data;
13- UI_Task *KBCT, *MCT;
148 UI_Task *mytask;
159 uint i;
1610 IO_DisplayControl *disp_ctrl;
@@ -19,7 +13,6 @@
1913 int x, y;
2014 UI_Timer *timer1, *timer2, *timer3;
2115 uint counter1, counter2, counter3;
22- UI_MouseCursor *mcursor;
2316
2417 i = 0;
2518 data = 0;
@@ -29,42 +22,8 @@
2922 mytask = System_MultiTask_GetNowTask();
3023 disp_ctrl = System_Display_Get_Controller();
3124
32- vramsheet = Sheet_Initialise();
33- Sheet_SetBuffer(vramsheet, disp_ctrl->vram, disp_ctrl->xsize, disp_ctrl->ysize, disp_ctrl->bpp);
25+ vramsheet = disp_ctrl->vramsheet;
3426
35- testsheet2 = Sheet_Initialise();
36- Sheet_SetBuffer(testsheet2, Null, 128, 64, 8);
37- for(y = 0; y < testsheet2->size.y; y++){
38- for(x = 0; x < testsheet2->size.x; x++){
39- ((uchar *)testsheet2->vram)[y * testsheet2->size.x + x] = y * 2 + x;
40- }
41- }
42- Drawing08_Fill_Rectangle(testsheet2->vram, testsheet2->size.x, 0xc6c6c6, 4, 24, testsheet2->size.x - 4 - 1, testsheet2->size.y - 4 - 1);
43- Drawing08_Put_String(testsheet2->vram, testsheet2->size.x, 4, 4, 0xffffff, "TestSheet2");
44- Sheet_SetParent(testsheet2, vramsheet);
45- Sheet_Show(testsheet2, 2, 80, 80);
46-
47- KBCT = System_MultiTask_Task_Initialise(0);
48- KBCT->tss->eip = (uint)&KeyboardControlTask;
49- KBCT->tss->cs = SYSTEM_CS << 3;
50- KBCT->tss->ss = SYSTEM_DS << 3;
51- KBCT->tss->ds = SYSTEM_DS << 3;
52- KBCT->tss->esp = (uint)System_Memory_Allocate(1024 * 32) + (1024 * 32);
53- System_MultiTask_Task_Run(KBCT);
54-
55-//Debug_Set_Breakpoint(0, KBCT, DR7_RW_WRITE_DATA, DR7_LEN_BYTE);
56-
57- mcursor = MouseCursor_Initialise(vramsheet);
58-
59- MCT = System_MultiTask_Task_Initialise(0);
60- MCT->tss->eip = (uint)&MouseControlTask;
61- MCT->tss->cs = SYSTEM_CS << 3;
62- MCT->tss->ss = SYSTEM_DS << 3;
63- MCT->tss->ds = SYSTEM_DS << 3;
64- MCT->tss->esp = (uint)System_Memory_Allocate(1024 * 32) + (1024 * 32);
65- MultiTask_Push_Arguments(MCT, 1, mcursor);
66- System_MultiTask_Task_Run(MCT);
67-
6827 Sheet_Drawing_Fill_Rectangle(vramsheet, 0xffffff, 0, 0, vramsheet->size.x - 1, vramsheet->size.y - 1);
6928 Sheet_Drawing_Put_String(vramsheet, 10, 10, 0x000000, "Welcome to CHNOSProject!");
7029
@@ -75,15 +34,13 @@
7534 snprintf(s, sizeof(s), "%d:0x%X %dx%d-%dbits", i, disp_ctrl->VBE.list_vmode[i].mode_number, disp_ctrl->VBE.list_vmode[i].xsize, disp_ctrl->VBE.list_vmode[i].ysize, disp_ctrl->VBE.list_vmode[i].bpp);
7635 Sheet_Drawing_Put_String(vramsheet, 10, 10 + 16 * 3, 0x000000, s);
7736
78- FIFO32_Put_Arguments(KBCT->fifo, 4, FIFOCMD_KBCT_SET_FOCUS_FIFO, mytask->fifo, MAIN_KEYBASE, 0);
79-
8037 for(;;){
8138 if(FIFO32_MyTaskFIFO_Status() == 0){
8239 System_MultiTask_Task_Sleep(mytask);
8340 } else{
8441 data = FIFO32_MyTaskFIFO_Get();
85- if(MAIN_KEYBASE <= data && data <= (MAIN_KEYBASE + 0xFFFF)){
86- data -= MAIN_KEYBASE;
42+ if(SIGNAL_KEY_OFFSET <= data && data <= (SIGNAL_KEY_OFFSET + 0xFFFF)){
43+ data -= SIGNAL_KEY_OFFSET;
8744 if(!(data & KEYID_MASK_BREAK) && (data & KEYID_MASK_EXTENDED)){
8845 if((data & KEYID_MASK_ID) == KEYID_CURSOR_U){
8946 if(i == 0){
@@ -127,6 +84,18 @@
12784 Drawing_Draw_Circle(disp_ctrl->vram, disp_ctrl->xsize, 100, 250, 0xc6c6c6, i);
12885 }
12986
87+ testsheet2 = Sheet_Initialise();
88+ Sheet_SetBuffer(testsheet2, Null, 128, 64, 8);
89+ for(y = 0; y < testsheet2->size.y; y++){
90+ for(x = 0; x < testsheet2->size.x; x++){
91+ ((uchar *)testsheet2->vram)[y * testsheet2->size.x + x] = y * 2 + x;
92+ }
93+ }
94+ Drawing08_Fill_Rectangle(testsheet2->vram, testsheet2->size.x, 0xc6c6c6, 4, 24, testsheet2->size.x - 4 - 1, testsheet2->size.y - 4 - 1);
95+ Drawing08_Put_String(testsheet2->vram, testsheet2->size.x, 4, 4, 0xffffff, "TestSheet2");
96+ Sheet_SetParent(testsheet2, vramsheet);
97+ Sheet_Show(testsheet2, 2, 80, 80);
98+
13099 testsheet = Sheet_Initialise();
131100 sheet_desktop = Sheet_Initialise();
132101 sheet08 = Sheet_Initialise();
@@ -186,7 +155,6 @@
186155 Sheet_Show(sheet32, 2, 420, vramsheet->size.y >> 1);
187156
188157 Sheet_SetParent(testsheet, vramsheet);
189- Sheet_Enable_InvisibleColor(testsheet, 0xc6c6c6);
190158 Sheet_Show(testsheet, 4, 10, 10);
191159
192160 timer1 = Timer_Initialise();
@@ -204,15 +172,13 @@
204172 counter3 = 0;
205173 Timer_Run(timer3);
206174
207- MouseCursor_Move_Relative(mcursor, vramsheet->size.x >> 1, vramsheet->size.y >> 1);
208-
209175 for(;;){
210176 if(FIFO32_MyTaskFIFO_Status() == 0){
211177 System_MultiTask_Task_Sleep(mytask);
212178 } else{
213179 data = FIFO32_MyTaskFIFO_Get();
214- if(MAIN_KEYBASE <= data && data <= (MAIN_KEYBASE + 0xFFFF)){
215- data -= MAIN_KEYBASE;
180+ if(SIGNAL_KEY_OFFSET <= data && data <= (SIGNAL_KEY_OFFSET + 0xFFFF)){
181+ data -= SIGNAL_KEY_OFFSET;
216182 if(!(data & KEYID_MASK_BREAK) && (data & KEYID_MASK_EXTENDED)){
217183 if((data & KEYID_MASK_ID) == KEYID_CURSOR_U){
218184 if(data & KEYID_MASK_STATE_SHIFT){
@@ -273,17 +239,12 @@
273239 }
274240 }
275241
276-void KeyboardControlTask(void)
242+void KeyboardControlTask(DATA_FIFO32 **InputFocus)
277243 {
278244 UI_Task *mytask;
279- uint data, offset;
280- DATA_FIFO32 *sendto;
281- uint args[5];
282- uint i;
245+ uint data;
283246
284- sendto = 0;
285247 data = 0;
286- offset = 0;
287248
288249 mytask = System_MultiTask_GetNowTask();
289250
@@ -304,31 +265,19 @@
304265 if(0x100 <= data && data <= 0x1ff){
305266 data -= 0x100;
306267 data = Keyboard_Decode_KeyCode(data);
307- if(sendto != 0 && data != 0){
308- FIFO32_Put(sendto, data + offset);
268+ if(InputFocus != 0 && data != 0){
269+ FIFO32_Put(*InputFocus, data + SIGNAL_KEY_OFFSET);
309270 }
310- } else if(data == FIFOCMD_KBCT_SET_FOCUS_FIFO){
311- args[0] = FIFOCMD_KBCT_SET_FOCUS_FIFO;
312- for(i = 1; i < 5; i++){
313- args[i] = FIFO32_MyTaskFIFO_Get();
314- }
315- if(args[4] == SIGNAL_ARGUMENTS_END){
316- sendto = (DATA_FIFO32 *)args[1];
317- offset = args[2];
318- } else{
319- #ifdef CHNOSPROJECT_DEBUG_KBCT
320- debug("KBCT:Invalid Arguments to Set Focus FIFO.\n");
321- #endif
322- }
323271 }
324272 }
325273 }
326274 }
327275
328-void MouseControlTask(UI_MouseCursor *mcursor)
276+void MouseControlTask(DATA_FIFO32 **InputFocus, UI_MouseCursor *mcursor)
329277 {
330278 UI_Task *mytask;
331279 uint data;
280+ DATA_FIFO32 *mfifo;
332281
333282 data = 0;
334283
@@ -338,7 +287,14 @@
338287 debug("MCT:MouseControlTask Start Running.\nMCT:UI_Task=0x%X\n", mytask);
339288 #endif
340289
290+ Initialise_Mouse();
291+
292+ #ifdef CHNOSPROJECT_DEBUG_MCT
293+ debug("MCT:Mouse Initialized.\n");
294+ #endif
295+
341296 MouseCursor_Show(mcursor);
297+// Mouse_Set_ReceiveFIFO(mytask->fifo, 0x100);
342298
343299 for(;;){
344300 if(FIFO32_MyTaskFIFO_Status() == 0){
@@ -345,11 +301,13 @@
345301 System_MultiTask_Task_Sleep(mytask);
346302 } else{
347303 data = FIFO32_MyTaskFIFO_Get();
348- #ifdef CHNOSPROJECT_DEBUG_KBCT
304+ #ifdef CHNOSPROJECT_DEBUG_MCT
349305 debug("MCT:Receive data from FIFO(data:0x%X).\n", data);
350306 #endif
351307 if(0x100 <= data && data <= 0x1ff){
352308
309+ } else if(data == TCM_INFO_DISPLAY_UPDATE_RESOLUTION){
310+ MouseCursor_Move_Absolute(mcursor, mcursor->cursor_sheet->parent->size.x >> 1, mcursor->cursor_sheet->parent->size.y >> 1);
353311 }
354312 }
355313 }
--- beta/tolset_chn_000/chnos_010/chnos/memory.c (revision 318)
+++ beta/tolset_chn_000/chnos_010/chnos/memory.c (revision 319)
@@ -44,6 +44,7 @@
4444 {
4545 IO_MemoryControl ctrl;
4646
47+ start = (void *)(((uint)start + 7) & ~7);
4748 size = (size + 7) & ~7;
4849
4950 //Memory Control配列が入る分より多く、管理対象のメモリを与えられているかチェック。
--- beta/tolset_chn_000/chnos_010/chnos/fifo.c (revision 318)
+++ beta/tolset_chn_000/chnos_010/chnos/fifo.c (revision 319)
@@ -49,7 +49,7 @@
4949
5050
5151 if(fifo->task != Null){
52- if(!fifo->task->flags.linked){
52+ if(fifo->task->flags.linked && !fifo->task->flags.running){
5353 #ifdef CHNOSPROJECT_DEBUG_FIFO
5454 debug("FIFO32_Put:Task run start.\n");
5555 #endif
--- beta/tolset_chn_000/chnos_010/chnos/mouse.c (revision 318)
+++ beta/tolset_chn_000/chnos_010/chnos/mouse.c (revision 319)
@@ -1,6 +1,10 @@
11
22 #include "core.h"
33
4+uint mouse_data0;
5+DATA_FIFO32 *mouse_fifo;
6+uint mouse_retv;
7+
48 uchar Mouse_Pattern_Standard[24][24] = {
59 ".**.....................",
610 "*O**....................",
@@ -28,13 +32,69 @@
2832 "***.....................",
2933 };
3034
31-void Mouse_SendCommand(uint data)
35+void Initialise_Mouse(void)
3236 {
33- KeyboardController_SendCommand(KEYCMD_SENDTO_MOUSE);
34- KeyboardController_SendData(data);
37+ mouse_data0 = 0;
38+ mouse_fifo = Null;
39+
40+ IO_CLI();
41+ System_GateDescriptor_Set(0x2c, (uint)asm_InterruptHandler2c, 0x02, AR_INTGATE32);
42+ ProgrammableInterruptController_InterruptMask_Clear(0x0c);
43+ IO_STI();
44+
45+ Mouse_SendCommand(MOUSECMD_ENABLE);
46+
3547 return;
3648 }
3749
50+void InterruptHandler2c(uint *esp)
51+{
52+ uint data;
53+
54+ data = IO_In8(PORT_KEYDATA);
55+
56+ ProgrammableInterruptController_InterruptRequest_Complete(0x0c);
57+
58+ if(mouse_fifo != 0){
59+ FIFO32_Put(mouse_fifo, data + mouse_data0);
60+ }
61+
62+ if(data == KEYDATA_ACK || data == KEYDATA_RESEND){
63+ mouse_retv = data;
64+ }
65+
66+ return;
67+}
68+
69+void Mouse_Set_ReceiveFIFO(DATA_FIFO32 *fifo, uint data0)
70+{
71+ mouse_data0 = data0;
72+ mouse_fifo = fifo;
73+
74+ return;
75+}
76+
77+void Mouse_SendCommand(uint cmd)
78+{
79+ KeyboardController_Wait_SendReady();
80+ IO_Out8(PORT_KEYCMD, KEYCMD_SENDTO_MOUSE);
81+
82+ for(;;){
83+ mouse_retv = 0;
84+ KeyboardController_Wait_SendReady();
85+ IO_Out8(PORT_KEYDATA, cmd);
86+ for(;;){
87+ if(mouse_retv == KEYDATA_ACK){
88+ return;
89+ }
90+ if(mouse_retv == KEYDATA_RESEND){
91+ break;
92+ }
93+ }
94+ }
95+ return;
96+}
97+
3898 UI_MouseCursor *MouseCursor_Initialise(UI_Sheet *parent)
3999 {
40100 UI_MouseCursor *mcursor;
@@ -92,12 +152,38 @@
92152 return 0;
93153 }
94154
95-uint MouseCursor_Move_Relative(UI_MouseCursor *mcursor, int apx, int apy)
155+uint MouseCursor_Move_Relative(UI_MouseCursor *mcursor, int rpx, int rpy)
96156 {
97157 if(mcursor == Null){
98158 return 1;
99159 }
100160
161+ rpx += mcursor->cursor_sheet->location.x;
162+ rpy += mcursor->cursor_sheet->location.y;
163+
164+ if(rpx < 0){
165+ rpx = 0;
166+ } else if((uint)rpx > mcursor->cursor_sheet->parent->size.x - 1){
167+ rpx = mcursor->cursor_sheet->parent->size.x - 1;
168+ }
169+
170+ if(rpy < 0){
171+ rpy = 0;
172+ } else if((uint)rpy > mcursor->cursor_sheet->parent->size.y - 1){
173+ rpy = mcursor->cursor_sheet->parent->size.y - 1;
174+ }
175+
176+ Sheet_Slide_Absolute(mcursor->cursor_sheet, rpx, rpy);
177+
178+ return 0;
179+}
180+
181+uint MouseCursor_Move_Absolute(UI_MouseCursor *mcursor, int apx, int apy)
182+{
183+ if(mcursor == Null){
184+ return 1;
185+ }
186+
101187 if(apx < 0){
102188 apx = 0;
103189 } else if((uint)apx > mcursor->cursor_sheet->parent->size.x - 1){
--- beta/tolset_chn_000/chnos_010/chnos/xception.c (revision 318)
+++ beta/tolset_chn_000/chnos_010/chnos/xception.c (revision 319)
@@ -57,7 +57,7 @@
5757 callbios->retvalue.eflags.eflags = esp[0x0c];
5858
5959 System_CallBIOS_Send_End_Of_Operation(False);
60- System_MultiTask_Task_Sleep(System_MultiTask_GetNowTask());
60+ System_MultiTask_Task_Kill(System_MultiTask_GetNowTask());
6161 } else{
6262 Error_Report(ERROR_CPU_EXCEPTION_06, esp);
6363 }
--- beta/tolset_chn_000/chnos_010/chnos/coredef0.h (revision 318)
+++ beta/tolset_chn_000/chnos_010/chnos/coredef0.h (revision 319)
@@ -12,6 +12,8 @@
1212 //#define CHNOSPROJECT_DEBUG_CALLBIOS
1313 //#define CHNOSPROJECT_DEBUG_FIFO
1414 //#define CHNOSPROJECT_DEBUG_KBCT
15+ //#define CHNOSPROJECT_DEBUG_MCT
16+ #define CHNOSPROJECT_DEBUG_MOUSE
1517 //#define CHNOSPROJECT_DEBUG_DISPLAY
1618 //#define CHNOSPROJECT_DEBUG_DRAWING
1719 #define CHNOSPROJECT_DEBUG_SHEET
@@ -208,13 +210,14 @@
208210 #define PORT_KEYDATA 0x0060
209211 #define PORT_KEYSTA 0x0064
210212 #define KEYSTA_SEND_NOTREADY 0x02
211-#define KEYCMD_WRITE_MODE 0x60
212-#define KBC_MODE 0x47
213+#define KEYCMD_WRITE_8042_MODE_REG 0x60
214+#define KBC_MODE 0x47 //Keyboard and Mouse Interrupt Enable.
213215 #define PORT_KEYCMD 0x0064
214216 #define KEYCMD_SENDTO_MOUSE 0xd4
215217 #define KEYCMD_LED 0xed
216218 #define KEYDATA_ACK 0xfa
217219 #define KEYDATA_RESEND 0xfe
220+#define MOUSECMD_ENABLE 0xf4
218221
219222 /*COM1 io port*/
220223 #define COM1_RX 0x03f8
@@ -310,7 +313,7 @@
310313
311314 /*FIFO buffer*/
312315 #define SIGNAL_ARGUMENTS_END 0xfefe1234
313-
316+#define SIGNAL_KEY_OFFSET 0x10000
314317 /*task*/
315318 #define TASK_FIFOSIZE (4 * 64)
316319
--- beta/tolset_chn_000/chnos_010/chnos/coredef1.h (revision 318)
+++ beta/tolset_chn_000/chnos_010/chnos/coredef1.h (revision 319)
@@ -261,6 +261,7 @@
261261 struct UI_TASK_STATE_FLAGS {
262262 unsigned initialized : 1;
263263 unsigned linked : 1;
264+ unsigned running : 1;
264265 unsigned first_run : 1;
265266 } flags;
266267 } UI_Task;
@@ -447,6 +448,7 @@
447448 ushort ysize;
448449 void *vram;
449450 DATA_FIFO32 *bios_signal;
451+ struct UI_SHEET *vramsheet;
450452 } IO_DisplayControl;
451453
452454 /*sheet*/
旧リポジトリブラウザで表示