/* 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);
}
}
*/
+ .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
.global _kernel_vector_033
_kernel_vector_033:
pushal
- movb $33, %al
+ movl $33, %eax
call _kernel_int_hdr
popal
iret
.global _kernel_vector_034
_kernel_vector_034:
pushal
- movb $34, %al
+ movl $34, %eax
call _kernel_int_hdr
popal
iret
.global _kernel_vector_035
_kernel_vector_035:
pushal
- movb $35, %al
+ movl $35, %eax
call _kernel_int_hdr
popal
iret
.global _kernel_vector_036
_kernel_vector_036:
pushal
- movb $36, %al
+ movl $36, %eax
call _kernel_int_hdr
popal
iret
.global _kernel_vector_037
_kernel_vector_037:
pushal
- movb $37, %al
+ movl $37, %eax
call _kernel_int_hdr
popal
iret
.global _kernel_vector_038
_kernel_vector_038:
pushal
- movb $38, %al
+ movl $38, %eax
call _kernel_int_hdr
popal
iret
.global _kernel_vector_039
_kernel_vector_039:
pushal
- movb $39, %al
+ movl $39, %eax
call _kernel_int_hdr
popal
iret
.global _kernel_vector_040
_kernel_vector_040:
pushal
- movb $40, %al
+ movl $40, %eax
call _kernel_int_hdr
popal
iret
.global _kernel_vector_041
_kernel_vector_041:
pushal
- movb $41, %al
+ movl $41, %eax
call _kernel_int_hdr
popal
iret
.global _kernel_vector_042
_kernel_vector_042:
pushal
- movb $42, %al
+ movl $42, %eax
call _kernel_int_hdr
popal
iret
.global _kernel_vector_043
_kernel_vector_043:
pushal
- movb $43, %al
+ movl $43, %eax
call _kernel_int_hdr
popal
iret
.global _kernel_vector_044
_kernel_vector_044:
pushal
- movb $44, %al
+ movl $44, %eax
call _kernel_int_hdr
popal
iret
.global _kernel_vector_045
_kernel_vector_045:
pushal
- movb $45, %al
+ movl $45, %eax
call _kernel_int_hdr
popal
iret
.global _kernel_vector_046
_kernel_vector_046:
pushal
- movb $46, %al
+ movl $46, %eax
call _kernel_int_hdr
popal
iret
.global _kernel_vector_047
_kernel_vector_047:
pushal
- movb $47, %al
+ movl $47, %eax
call _kernel_int_hdr
popal
iret
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));
}
--- /dev/null
+/**
+ * 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 */
--- /dev/null
+/**
+ * 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 */
CSRCS += ../main.c
CSRCS += ../kernel_cfg.c
CSRCS += ../sample.c
+CSRCS += ../ostimer.c
CSRCS += ../console.c
-# CSRCS += ../ostimer.c
-
* @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/
*/
/* %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);
}
/** %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);
-*/
}
/* %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});