OSDN Git Service

(none)
authorryuz <ryuz>
Tue, 6 May 2008 10:29:51 +0000 (10:29 +0000)
committerryuz <ryuz>
Tue, 6 May 2008 10:29:51 +0000 (10:29 +0000)
kernel/source/arch/proc/ia32/i386/gcc/kexc_hdr.S
sample/ia32/pcat/console.c
sample/ia32/pcat/gcc/crt0.S
sample/ia32/pcat/main.c
sample/ia32/pcat/ostimer.c
sample/ia32/pcat/sample.c

index f83f674..dce1414 100755 (executable)
@@ -39,22 +39,6 @@ _kernel_vector_000:
                                .global _kernel_vector_001
 _kernel_vector_001:
                                pushal
-                               
-                               /* デバッグ用一時埋め込み */
-                               movl    32(%esp), %eax  /* EIP */
-                               
-                               pushl   %eax
-                               call    Debug_PutHex
-                               popl    %eax
-                               
-                               pushl   $'\n'
-                               call    Debug_PutChar
-                               popl    %eax
-                               
-                               popal
-                               iret
-                               
-                               
                                movb    $1, %al
                                call    _kernel_exc_hdr
                                popal
index 4742183..911dbe7 100755 (executable)
@@ -26,9 +26,16 @@ void Console_Initialize(void)
 {
        int i;
        
+       /* COM1の初期化 */
+       _kernel_outpb(0x3fb, 0x83);
+       _kernel_outpb(0x3f8, 0x0c);             /* 9600bps */
+       _kernel_outpb(0x3f9, 0x00);
+       _kernel_outpb(0x3fb, 0x03);
+       
+       
+       /* Text-VRAM初期化 */
        Console_x = 0;
        Console_y = 0;
-       
        for ( i = 0; i < 80*25; i++ )
        {
                TEXTVRAM[i] = 0x0720;
@@ -41,6 +48,7 @@ void Console_PutChar(int c)
 {
        int i, j;
        
+       /* Text-VRAM出力 */
        if ( c == '\n' )
        {
                Console_x = 0;
@@ -68,6 +76,15 @@ void Console_PutChar(int c)
                TEXTVRAM[(Console_y*80)+Console_x] = ((c & 0xff) | 0x0700);
                Console_x++;
        }
+       
+       /* COM出力 */
+       if ( c == '\n' )
+       {
+               c = '\r';
+       }
+       while ( !(_kernel_inpb(0x3fd) & 0x20) )
+               ;
+       _kernel_outpb(0x3f8, c);
 }
 
 
@@ -84,6 +101,8 @@ void Console_PutString(const char *text)
 
 
 
+
+/* 以下デバッグ用出力 */
 #include "../../aplfw/library/algorithm/stringformat/stringformat.h"
 
 
@@ -91,28 +110,22 @@ int Debug_Put(int c, void *Param)
 {
        Console_PutChar(c);
        
-       /* COM出力 */
-       if ( c == '\n' )
-       {
-               c = '\r';
-       }
-       while ( !(_kernel_inpb(0x3fd) & 0x20) )
-               ;
-       _kernel_outpb(0x3f8, c);
-       
        return 1;
 }
 
+
 int Debug_PutChar(int c)
 {
        return Debug_Put(c, 0);
 }
 
+
 int Debug_PutHex(int num)
 {
        return Debug_PrintFormat("%08x", num);
 }
 
+
 int Debug_PrintFormat(const char *pszFormat, ...)
 {
        va_list argptr;
@@ -126,7 +139,6 @@ int Debug_PrintFormat(const char *pszFormat, ...)
 }
 
 
-
 /* %jp{文字列出力} */
 void Debug_PutString(int y, int x, const char *text)
 {
@@ -139,46 +151,5 @@ void Debug_PutString(int y, int x, const char *text)
 }
 
 
-#if 0
-
-static char HexChar(int num)
-{
-       if ( num < 10 )
-       {
-               return '0' + num;
-       }
-       else
-       {
-               return 'a' + (num - 10);
-       }
-}
-
-
-/* %jp{文字列出力} */
-void Debug_PutHex(int y, int x, int num)
-{
-       int i;
-       
-       for ( i = 0; i < 8; i++ )
-       {
-               TEXTVRAM[(y*80+x+i)*2] = HexChar(((num >> 24) & 0xf));
-               num <<= 4;
-       }
-}
-
-
-void Debug_MemDump(unsigned char *mem)
-{
-       int i;
-       
-       for ( i = 0; i < 80*25; i++ )
-       {
-               TEXTVRAM[i*2] = HexChar((*mem >> 4) & 0xf);
-               TEXTVRAM[i*2] = HexChar((*mem >> 0) & 0xf);
-               mem++;
-       }
-}
-
-#endif
 
 /* end of file */
index 1cb8fec..308d7cf 100755 (executable)
@@ -46,23 +46,6 @@ __main:
                                ret                     /* 何もしない */
 
 
-                               
-                               .global _debug_on
-_debug_on:             
-                               pushfl
-                               popl    %eax
-                               orl             $0x0100, %eax
-                               pushl   %eax
-                               popfl
-                               ret
-
-                               .global _debug_getflag
-_debug_getflag:
-                               pushfl
-                               popl    %eax
-                               ret
-
-
 
                                .end
 
index 84b74ba..9a52494 100755 (executable)
@@ -19,57 +19,8 @@ extern VP _kernel_inh_tbl[224];
 int main()
 {
        Console_Initialize();
-
-       /* 9600bps */
-       _kernel_outpb(0x3fb, 0x83);
-       _kernel_outpb(0x3f8, 0x0c);
-       _kernel_outpb(0x3f9, 0x00);
-       _kernel_outpb(0x3fb, 0x03);
-
-/*     _kernel_outpb(0x3f8, 'A');
-       _kernel_outpb(0x3f8, 'B');
-       _kernel_outpb(0x3f8, 'C');
-       */
-       
        
        
-       Debug_PrintFormat("Debug start\n");
-       Debug_PrintFormat("hoge : %08x\n", _debug_getflag());
-/*     Debug_PrintFormat("hoge : %08x\n", (int)_kernel_inh_tbl);       */
-
-#if 0
-       {
-               int i;
-               UW *p = 0x8000;
-               for ( 0x8000; ; )
-               {
-               }
-       }
-       for ( ; ; )
-       {
-               Debug_PrintFormat("Debug HOS\n");
-       }
-#endif
-
-#if 0
-       for ( ; ; )
-       {
-               Console_PutString("Hello HOS world!\n");
-       }
-#endif
-
-
-/*
-       volatile char   *tvram = (volatile char *)0xb8000;
-       const char              msg[] = "Hello Wold!";
-       int                             i;
-       
-       for ( i = 0; msg[i] != '\0'; i++ )
-       {
-               tvram[i*2] = msg[i];
-       }
-*/
-
        /* %jp{カーネルの動作開始} */
        vsta_knl();
        
index 2bd3a43..0526b76 100755 (executable)
@@ -26,7 +26,7 @@ void OsTimer_Initialize(VP_INT exinf)
        
 /*     _debug_on();    */
        
-#if 0
+#if 1
        /* %jp{割り込みサービスルーチン生成} */
        cisr.isratr = TA_HLNG;
        cisr.exinf  = 0;
@@ -44,14 +44,11 @@ void OsTimer_Initialize(VP_INT exinf)
 #endif
        
        
-       
        /* %jp{タイマ動作開始} */
        _kernel_outpb(0x43, 0x34);
        _kernel_outpb(0x40, 0x9c);      /* 11932 = 0x2e9c */
        _kernel_outpb(0x40, 0x2e);
        
-       *(volatile char *)0xb8008 = 'C';
-       
        /* %jp{割込み許可} */
        ena_int(0);
 }
index fca0e24..98dacfd 100755 (executable)
@@ -71,9 +71,9 @@ void rand_wait(void)
        int r;
        
        wai_sem(SEMID_RAND);
-       r = 100;        /* rand();      */
+       r = 100;        // rand();
        sig_sem(SEMID_RAND);
-
+       
        dly_tsk((r % 1000) + 10);
 }
 
@@ -88,7 +88,7 @@ void print_state(int num, char *text)
        /* %jp{メモリ取得} */
        get_mpf(mpfid, &mem);
        msg = (T_PRINT_MSG *)mem;
-
+       
        /* %jp{文字列生成} */
        msg->text[0] = '0' + num;
        msg->text[1] = ' ';