4: 2007-01-21 (日) 21:35:04  |
現: 2024-01-06 (土) 22:39:09  |
| | | | |
| | load_idtr(LIMIT_IDT, ADR_IDT); | | load_idtr(LIMIT_IDT, ADR_IDT); |
| | + | |
| | /* IDTの設定 */ | | /* IDTの設定 */ |
| | set_gatedesc(idt + 0x0c, (int) asm_inthandler0c, 2 * 8, AR_INTGATE32); | | set_gatedesc(idt + 0x0c, (int) asm_inthandler0c, 2 * 8, AR_INTGATE32); |
| | | | |
| | load_idtr(LIMIT_IDT, ADR_IDT); | | load_idtr(LIMIT_IDT, ADR_IDT); |
| | + | |
| | /* IDTの設定 */ | | /* IDTの設定 */ |
| | set_gatedesc(idt + 0x0c, (int) asm_inthandler0c, 2 * 8, AR_INTGATE32); | | set_gatedesc(idt + 0x0c, (int) asm_inthandler0c, 2 * 8, AR_INTGATE32); |
| | io_out8(PIC0_OCW2, 0x61); /* IRQ-01受付完了をPICに通知 */ | | io_out8(PIC0_OCW2, 0x61); /* IRQ-01受付完了をPICに通知 */ |
| | data = io_in8(PORT_KEYDAT); | | data = io_in8(PORT_KEYDAT); |
| | + | |
| | sprintf(s, "%02X", data); | | sprintf(s, "%02X", data); |
| | boxfill8(binfo->vram, binfo->scrnx, COL8_008484, 0, 16, 15, 31); | | boxfill8(binfo->vram, binfo->scrnx, COL8_008484, 0, 16, 15, 31); |
| | putfonts8_asc(binfo->vram, binfo->scrnx, 0, 16, COL8_FFFFFF, s); | | putfonts8_asc(binfo->vram, binfo->scrnx, 0, 16, COL8_FFFFFF, s); |
| | + | |
| | return; | | return; |
| | | | |
| | data = io_in8(PORT_KEYDAT); | | data = io_in8(PORT_KEYDAT); |
| | fifo32_put(keyfifo, data + keydata0); | | fifo32_put(keyfifo, data + keydata0); |
| | + | |
| | /*実験部分*/ | | /*実験部分*/ |
| | struct BOOTINFO *binfo = (struct BOOTINFO *) ADR_BOOTINFO; | | struct BOOTINFO *binfo = (struct BOOTINFO *) ADR_BOOTINFO; |
| | unsigned char s[4]; | | unsigned char s[4]; |
| | + | |
| | sprintf(s, "%02X", data); | | sprintf(s, "%02X", data); |
| | boxfill8(binfo->vram, binfo->scrnx, COL8_008484, 0, 16, 15, 31); | | boxfill8(binfo->vram, binfo->scrnx, COL8_008484, 0, 16, 15, 31); |
| | putfonts8_asc(binfo->vram, binfo->scrnx, 0, 16, COL8_FFFFFF, s); | | putfonts8_asc(binfo->vram, binfo->scrnx, 0, 16, COL8_FFFFFF, s); |
| | /*-------------------*/ | | /*-------------------*/ |
| | + | |
| | return; | | return; |
| | } | | } |
| | #include <stdio.h> | | #include <stdio.h> |
| | #include "bootpack.h" | | #include "bootpack.h" |
| | + | |
| | void inthandler26(int *esp) | | void inthandler26(int *esp) |
| | /* FDコントローラからの割り込み */ | | /* FDコントローラからの割り込み */ |
| | { | | { |
| | + | |
| | /*実験部分*/ | | /*実験部分*/ |
| | io_out8(PIC0_OCW2, 0x66); /* IRQ-06受付完了をPICに通知 */ | | io_out8(PIC0_OCW2, 0x66); /* IRQ-06受付完了をPICに通知 */ |
| | + | |
| | struct BOOTINFO *binfo = (struct BOOTINFO *) ADR_BOOTINFO; | | struct BOOTINFO *binfo = (struct BOOTINFO *) ADR_BOOTINFO; |
| | unsigned char s[4]; | | unsigned char s[4]; |
| | + | |
| | sprintf(s, "%02X", data); | | sprintf(s, "%02X", data); |
| | boxfill8(binfo->vram, binfo->scrnx, COL8_008484, 0, 16, 15, 31); | | boxfill8(binfo->vram, binfo->scrnx, COL8_008484, 0, 16, 15, 31); |
| | putfonts8_asc(binfo->vram, binfo->scrnx, 0, 0, COL8_FF00FF, s); | | putfonts8_asc(binfo->vram, binfo->scrnx, 0, 0, COL8_FF00FF, s); |
| | /*-------------------*/ | | /*-------------------*/ |
| - | | + | |
| | + | |
| | return; | | return; |
| | } | | } |
| | char a; | | char a; |
| | a = io_in8(0x03f4); | | a = io_in8(0x03f4); |
| | + | |
| | int s[70]; | | int s[70]; |
| | sprintf(s, "0x03f4 = %d, 0x11 & = %d",a,a & 0x11); | | sprintf(s, "0x03f4 = %d, 0x11 & = %d",a,a & 0x11); |
| | はりぼてWikiでは、この確認が終わったら | | はりぼてWikiでは、この確認が終わったら |
| | 次に以下を送信したいバイト数だけ繰り返します。 | | 次に以下を送信したいバイト数だけ繰り返します。 |
| | + | |
| | * io_in8(0x03f4) & 0xc0 が 0x80 になるのを待つ | | * io_in8(0x03f4) & 0xc0 が 0x80 になるのを待つ |
| | * io_out8(0x03f5, データ); | | * io_out8(0x03f5, データ); |
| | | | |
| | ええと。このへんのことはP507あたりに書いてあるのでと。 | | ええと。このへんのことはP507あたりに書いてあるのでと。 |
| | + | |
| | + | そんなわけで、こんな内臓コマンドを試作して実行してみたが、割り込みもなにも発生しないようだ。コマンドの解釈が間違っているのだろうなぁ・・・ |
| | + | |
| | + | |
| | + | /*FDの実験*/ |
| | + | void cmd_fdtest(struct CONSOLE *cons) |
| | + | { |
| | + | char s[30]; |
| | + | char counter = 3; |
| | + | int p; |
| | + | |
| | + | struct FIFO32 timerfifox; |
| | + | struct TIMER *timerx; |
| | + | int timerbuf[128]; |
| | + | |
| | + | fifo32_init(&timerfifox,128,timerbuf,0); |
| | + | |
| | + | timerx = timer_alloc(); |
| | + | timer_init(timerx,&timerfifox,128); |
| | + | timer_settime(timerx,100); |
| | + | |
| | + | //3秒待ち |
| | + | for(;;){ |
| | + | io_cli(); |
| | + | p = fifo32_get(&timerfifox); |
| | + | if (counter == 0){break;} |
| | + | |
| | + | if( p == 128 ){ |
| | + | sprintf(s, "Wait %dSec...\n",counter); |
| | + | cons_putstr0(cons, s); |
| | + | counter--; |
| | + | timer_settime(timerx,100); |
| | + | } |
| | + | io_sti(); |
| | + | } |
| | + | io_sti(); |
| | + | |
| | + | |
| | + | |
| | + | |
| | + | //0x03f4のチェック |
| | + | sprintf(s, "Check 0x03f4"); |
| | + | cons_putstr0(cons, s); |
| | + | cons_newline(cons); |
| | + | |
| | + | char a; |
| | + | a = io_in8(0x03f4);a = a & 0x11; |
| | + | if ( a == 0 ) { |
| | + | sprintf(s, "OK! 0x03f4 & 0x11 is 0!"); |
| | + | cons_putstr0(cons, s); |
| | + | cons_newline(cons); |
| | + | } |
| | + | |
| | + | //コマンドの送信 |
| | + | sprintf(s, "Start command send..."); |
| | + | cons_putstr0(cons, s); |
| | + | cons_newline(cons); |
| | + | |
| | + | |
| | + | io_out8(0x03f5, 0x07); |
| | + | sprintf(s, "Send 0x03f5 [0x07]"); |
| | + | cons_putstr0(cons, s); |
| | + | cons_newline(cons); |
| | + | |
| | + | while(io_in8(0x03f4) & 0xC0 == 0x80 ) |
| | + | |
| | + | io_out8(0x03f5, 0x00); |
| | + | sprintf(s, "Send 0x03f5 [0x00]"); |
| | + | cons_putstr0(cons, s); |
| | + | cons_newline(cons); |
| | + | |
| | + | |
| | + | timer_free(&timerx); |
| | + | |
| | + | return; |
| | + | } |
| | + | /*---------------------*/ |