{
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;
{
int i, j;
+ /* Text-VRAM出力 */
if ( c == '\n' )
{
Console_x = 0;
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);
}
+
+/* 以下デバッグ用出力 */
#include "../../aplfw/library/algorithm/stringformat/stringformat.h"
{
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;
}
-
/* %jp{文字列出力} */
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 */
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();
/* _debug_on(); */
-#if 0
+#if 1
/* %jp{割り込みサービスルーチン生成} */
cisr.isratr = TA_HLNG;
cisr.exinf = 0;
#endif
-
/* %jp{タイマ動作開始} */
_kernel_outpb(0x43, 0x34);
_kernel_outpb(0x40, 0x9c); /* 11932 = 0x2e9c */
_kernel_outpb(0x40, 0x2e);
- *(volatile char *)0xb8008 = 'C';
-
/* %jp{割込み許可} */
ena_int(0);
}