OSDN Git Service

(none)
authorryuz <ryuz>
Sun, 4 May 2008 09:05:51 +0000 (09:05 +0000)
committerryuz <ryuz>
Sun, 4 May 2008 09:05:51 +0000 (09:05 +0000)
kernel/source/arch/irc/ia32/pcat/kexe_irc.c
kernel/source/arch/proc/ia32/i386/gcc/kint_hdr.S
kernel/source/arch/proc/ia32/i386/kini_prc.c
sample/ia32/pcat/console.c [new file with mode: 0755]
sample/ia32/pcat/console.h [new file with mode: 0755]
sample/ia32/pcat/gcc/gmake.mak
sample/ia32/pcat/ostimer.c
sample/ia32/pcat/sample.c
sample/ia32/pcat/system.cfg

index bb9436d..61e067f 100755 (executable)
@@ -27,11 +27,11 @@ void _kernel_exe_irc(INHNO inhno)
        /* EOI */
        if ( intno < 8 )
        {
-               _kernel_outpb(_KERNEL_IRC_PIC1_OCW2, (inhno | 0x60));
+               _kernel_outpb(_KERNEL_IRC_PIC1_OCW2, (intno | 0x60));
        }
        else
        {
-               _kernel_outpb(_KERNEL_IRC_PIC2_OCW2, ((inhno - 8) | 0x60));
+               _kernel_outpb(_KERNEL_IRC_PIC2_OCW2, ((intno - 8) | 0x60));
                _kernel_outpb(_KERNEL_IRC_PIC1_OCW2, 0x62);
        }
 }
index b973cea..5b3f5aa 100755 (executable)
@@ -6,6 +6,10 @@
  */
 
 
+                               .extern _kernel_sta_inh
+                               .extern _kernel_exe_inh
+                               .extern _kernel_end_inh
+
 
                                .code32
                                .text
  ************************************************/
                                .global _kernel_int_hdr
 _kernel_int_hdr:
+                               push    %eax
+                               call    _kernel_sta_inh
+                               call    _kernel_exe_inh
+                               call    _kernel_end_inh
+                               add             $4, %esp
                                ret
 
 
 
-
                                .global _kernel_vector_032
 _kernel_vector_032:
                                pushal
-                               movb    $32, %al
+                               movl    $32, %eax
                                call    _kernel_int_hdr
                                popal
                                iret
@@ -32,7 +40,7 @@ _kernel_vector_032:
                                .global _kernel_vector_033
 _kernel_vector_033:
                                pushal
-                               movb    $33, %al
+                               movl    $33, %eax
                                call    _kernel_int_hdr
                                popal
                                iret
@@ -40,7 +48,7 @@ _kernel_vector_033:
                                .global _kernel_vector_034
 _kernel_vector_034:
                                pushal
-                               movb    $34, %al
+                               movl    $34, %eax
                                call    _kernel_int_hdr
                                popal
                                iret
@@ -48,7 +56,7 @@ _kernel_vector_034:
                                .global _kernel_vector_035
 _kernel_vector_035:
                                pushal
-                               movb    $35, %al
+                               movl    $35, %eax
                                call    _kernel_int_hdr
                                popal
                                iret
@@ -56,7 +64,7 @@ _kernel_vector_035:
                                .global _kernel_vector_036
 _kernel_vector_036:
                                pushal
-                               movb    $36, %al
+                               movl    $36, %eax
                                call    _kernel_int_hdr
                                popal
                                iret
@@ -64,7 +72,7 @@ _kernel_vector_036:
                                .global _kernel_vector_037
 _kernel_vector_037:
                                pushal
-                               movb    $37, %al
+                               movl    $37, %eax
                                call    _kernel_int_hdr
                                popal
                                iret
@@ -72,7 +80,7 @@ _kernel_vector_037:
                                .global _kernel_vector_038
 _kernel_vector_038:
                                pushal
-                               movb    $38, %al
+                               movl    $38, %eax
                                call    _kernel_int_hdr
                                popal
                                iret
@@ -80,7 +88,7 @@ _kernel_vector_038:
                                .global _kernel_vector_039
 _kernel_vector_039:
                                pushal
-                               movb    $39, %al
+                               movl    $39, %eax
                                call    _kernel_int_hdr
                                popal
                                iret
@@ -88,7 +96,7 @@ _kernel_vector_039:
                                .global _kernel_vector_040
 _kernel_vector_040:
                                pushal
-                               movb    $40, %al
+                               movl    $40, %eax
                                call    _kernel_int_hdr
                                popal
                                iret
@@ -96,7 +104,7 @@ _kernel_vector_040:
                                .global _kernel_vector_041
 _kernel_vector_041:
                                pushal
-                               movb    $41, %al
+                               movl    $41, %eax
                                call    _kernel_int_hdr
                                popal
                                iret
@@ -104,7 +112,7 @@ _kernel_vector_041:
                                .global _kernel_vector_042
 _kernel_vector_042:
                                pushal
-                               movb    $42, %al
+                               movl    $42, %eax
                                call    _kernel_int_hdr
                                popal
                                iret
@@ -112,7 +120,7 @@ _kernel_vector_042:
                                .global _kernel_vector_043
 _kernel_vector_043:
                                pushal
-                               movb    $43, %al
+                               movl    $43, %eax
                                call    _kernel_int_hdr
                                popal
                                iret
@@ -120,7 +128,7 @@ _kernel_vector_043:
                                .global _kernel_vector_044
 _kernel_vector_044:
                                pushal
-                               movb    $44, %al
+                               movl    $44, %eax
                                call    _kernel_int_hdr
                                popal
                                iret
@@ -128,7 +136,7 @@ _kernel_vector_044:
                                .global _kernel_vector_045
 _kernel_vector_045:
                                pushal
-                               movb    $45, %al
+                               movl    $45, %eax
                                call    _kernel_int_hdr
                                popal
                                iret
@@ -136,7 +144,7 @@ _kernel_vector_045:
                                .global _kernel_vector_046
 _kernel_vector_046:
                                pushal
-                               movb    $46, %al
+                               movl    $46, %eax
                                call    _kernel_int_hdr
                                popal
                                iret
@@ -144,7 +152,7 @@ _kernel_vector_046:
                                .global _kernel_vector_047
 _kernel_vector_047:
                                pushal
-                               movb    $47, %al
+                               movl    $47, %eax
                                call    _kernel_int_hdr
                                popal
                                iret
index e557ba3..4d0ce98 100755 (executable)
@@ -26,7 +26,7 @@ UW  _kernel_idt[256*2];
 void _kernel_set_idt(INT vector, UB type, UH seg, UW offset)
 {
        _kernel_idt[vector*2+0] = ((((UW)offset) & 0xffff) | (seg << 16));
-       _kernel_idt[vector*2+1] = ((type << 8) | ((((UW)offset) & 0xffff) << 16));
+       _kernel_idt[vector*2+1] = ((type << 8) | 0x00008000 | ((UW)offset & 0xffff0000));
 }
 
 
diff --git a/sample/ia32/pcat/console.c b/sample/ia32/pcat/console.c
new file mode 100755 (executable)
index 0000000..9aec67b
--- /dev/null
@@ -0,0 +1,67 @@
+/** 
+ *  Sample program for Hyper Operating System V4 Advance
+ *
+ * @file  puts.c
+ * @brief %jp{モニタへの出力}%en{console output}
+ *
+ * Copyright (C) 1998-2006 by Project HOS
+ * http://sourceforge.jp/projects/hos/
+ */
+
+
+#include "kernel.h"
+#include "console.h"
+
+
+#define TEXTVRAM       ((volatile UB *)0x000b8000)
+
+
+
+static int             Console_x;
+static int             Console_y;
+
+
+
+/* %jp{1文字出力} */
+void Console_PutChar(int c)
+{
+       int i, j;
+       
+       if ( c == '\n' )
+       {
+               Console_x = 0;
+               if ( Console_y < 24 )
+               {
+                       Console_y++;
+               }
+               else
+               {
+                       for ( i = 0; i < 24; i++ )
+                       {
+                               for ( j = 0; j < 80; j++ )
+                               {
+                                       TEXTVRAM[(i*80+j)*2] = TEXTVRAM[((i+1)*80+j)*2];
+                               }
+                       }
+               }
+       }
+       else
+       {
+               TEXTVRAM[(Console_y*80+Console_x)*2] = c;
+               Console_x++;
+       }
+}
+
+
+/* %jp{文字列出力} */
+void Console_PutString(const char *text)
+{
+       while ( *text != '\0' )
+       {
+               Console_PutChar(*text);
+               text++;
+       }
+}
+
+
+/* end of file */
diff --git a/sample/ia32/pcat/console.h b/sample/ia32/pcat/console.h
new file mode 100755 (executable)
index 0000000..9d66478
--- /dev/null
@@ -0,0 +1,18 @@
+/** 
+ *  Sample program for Hyper Operating System V4 Advance
+ *
+ * @file  puts.c
+ * @brief %jp{モニタへの出力}%en{console output}
+ *
+ * Copyright (C) 1998-2006 by Project HOS
+ * http://sourceforge.jp/projects/hos/
+ */
+
+
+
+void Console_PutChar(int c);                                   /* %jp{1文字出力} */
+void Console_PutString(const char *text);              /* %jp{文字列出力} */
+
+
+
+/* end of file */
index 568ee03..ca916c2 100755 (executable)
@@ -89,10 +89,9 @@ ASRCS += ./crt0.S
 CSRCS += ../main.c
 CSRCS += ../kernel_cfg.c
 CSRCS += ../sample.c
+CSRCS += ../ostimer.c
 CSRCS += ../console.c
 
-# CSRCS += ../ostimer.c
-
 
 
 
index 8887d06..6fc89e1 100755 (executable)
@@ -4,7 +4,7 @@
  * @file  ostimer.c
  * @brief %jp{OSタイマ}%en{OS timer}
  *
- * Copyright (C) 1998-2006 by Project HOS
+ * Copyright (C) 1998-2008 by Project HOS
  * http://sourceforge.jp/projects/hos/
  */
 
@@ -25,12 +25,17 @@ void OsTimer_Initialize(VP_INT exinf)
        /* %jp{割り込みサービスルーチン生成} */
        cisr.isratr = TA_HLNG;
        cisr.exinf  = 0;
-       cisr.intno  = 2;
+       cisr.intno  = 0;
        cisr.isr    = (FP)OsTimer_Isr;
        acre_isr(&cisr);
-       ena_int(2);
        
        /* %jp{タイマ動作開始} */
+       _kernel_outpb(0x43, 0x34);
+       _kernel_outpb(0x40, 0x9c);      /* 11932 = 0x2e9c */
+       _kernel_outpb(0x40, 0x2e);
+       
+       /* %jp{割込み許可} */
+       ena_int(0);
 }
 
 
index 43eecbe..6644a2f 100755 (executable)
@@ -63,14 +63,13 @@ void Sample_Initialize(VP_INT exinf)
 /** %jp{適当な時間待つ} */
 void rand_wait(void)
 {
-/*     int r;
+       int r;
 
        wai_sem(SEMID_RAND);
-       r = rand();     
+       r = 100;        /* rand();      */
        sig_sem(SEMID_RAND);
 
        dly_tsk((r % 1000) + 10);
-*/
 }
 
 
index 41ae31e..9ff19e2 100755 (executable)
@@ -22,13 +22,11 @@ KERNEL_MAX_ISRID(4);
 
 
 /* %jp{OSタイマの設定}%en{OS timer} */
-/*
 INCLUDE("\"ostimer.h\"");
 ATT_INI({TA_HLNG, 0, OsTimer_Initialize});
-*/
 
-/* %jp{サンプル}%en{Sample program} */
 
+/* %jp{サンプル}%en{Sample program} */
 INCLUDE("\"sample.h\"");
 ATT_INI({TA_HLNG, 0, Sample_Initialize});
 CRE_TSK(TSKID_PRINT,   {TA_HLNG, 1, Sample_Print, 1, 1024, NULL});