flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > PIC, IRQ, IDT, and ISR's...? Goto page Previous 1, 2 |
Author |
|
vendu 16 Nov 2014, 00:16
First of all, I just heard about this cool board and this is my first post. I hope it's not too off-topic to link some C code with inline assembly macros, so here you go:
trap.h And for more info on how to use this junk: trap.c I hope this helps. _________________ ----8<---- /* vendu */ |
|||
16 Nov 2014, 00:16 |
|
newport 16 Nov 2014, 20:59
Ok... after much deliberation and testing, I have found that I'm receiving an Invalid Opcode error which is probably why my keyboard IRQ was not firing... now I've got to track down what's causing this error. Anybody had experience with this?
|
|||
16 Nov 2014, 20:59 |
|
BAiC 17 Nov 2014, 01:42
that could be caused by a bunch of stuff.. these are just some cases I could think of off-hand:
1) you jump to an uninitialized region of memory. this is extremely easy to do with jump tables. it can also happen with loaders that send the data to a different location than the jump point. 2) unintentional SMC. this can happen if you keep data between blocks of code and write to it with array notation or loops with errant induction values. 3, and this is a really advanced one, you use FASMs data processing capabilities to generate errant code. the most likely scenario IMO is that the interrupt table address isn't pointing to the correct address of the code. _________________ byte me. |
|||
17 Nov 2014, 01:42 |
|
BAiC 17 Nov 2014, 03:25
are you sure there is an Invalid Opcode exception? I modified the last instructions (your infinite loop) of your kernel code as such:
Code: @@: rdtsc shr eax, 29 add eax, 'A ! ' mov[0xB8000], eax jmp @b it's an infinite loop that cycles through the first 8 letters of the alphabet slow enough to see them. it doesn't stop which means an exception doesn't happen. pressing a key gets ignored. _________________ byte me. |
|||
17 Nov 2014, 03:25 |
|
BAiC 17 Nov 2014, 03:32
found it.
you don't initialize the interrupt mask register correctly. in order to disable an interrupt you write a 1 to the bit. writing a 0 will enable the interrupt. on line 182 of 'bootStage2.asm' it says: Code: mov al, 0FFh it should be something equivalent to: Code: mov al, 1111'1101b ; enable the keyboard interrupt while disabling everything else _________________ byte me. Last edited by BAiC on 18 Nov 2014, 04:24; edited 1 time in total |
|||
17 Nov 2014, 03:32 |
|
newport 17 Nov 2014, 19:21
Thank you very much BAiC! I will try these suggestions as soon as I get back in town..
|
|||
17 Nov 2014, 19:21 |
|
newport 18 Nov 2014, 06:32
BAiC wrote: found it. Hot Dog! .. That fixed it... Thanks so much! I also changed the kernel endless loop like you said, and sure-enough, it cycles through the letters.. cool... I would have never figured this out on my own... |
|||
18 Nov 2014, 06:32 |
|
l_inc 18 Nov 2014, 12:12
newport
Quote: Hot Dog! .. That fixed it... Thanks so much! [...] I would have never figured this out on my own... I suppose, I pointed out to that problem at the very beginning of the topic. _________________ Faith is a superposition of knowledge and fallacy |
|||
18 Nov 2014, 12:12 |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.