need help adding int 9 ISR to 'meaty skeleton'
Posted: Thu Jan 28, 2016 12:03 am
I am running Ubuntu 14.04 on a 32-bit DELL laptop. I have the gcc cross compiler installed. I did OSDEV tutorial BARE BONES and moved on to MEATY SKELETON. I have done a lot of reading in OSDEV. The first thing to do seems to be to add an ISR to provide the kernel with input from the keyboard. Here's the program I made for installing the ISR for INT 9, which needs to be run during boot up:
The 21 bytes of hex are this:
It reads the ascii byte stored in the screen buffer at address 0:041e and returns it to the OS in half register al. The correctness of that reasoning and the actual code are questionable, however that is not my question. I have two questions:
1) where do I put the int9 program (that needs to install the ISR at boot time) in the tree of the MEATY SKELETON and how do I get it to run at boot time?
2) how do I pass the returned byte into the tree of the MEATY SKELETON? There is no variable name for the byte and no name or label for the program (ISR) that returns it. I have studied the MEATY SKELETON and I see the likely places to pass it in are in tty.c or putchar.c. There's no way to do:
extern void int9(char c) - because there's no label int9.
TIA. Bill S.
Code: Select all
global int9
SECTION .text
int9:
mov ax,0xf000
mov ds,ax
mov byte [ds:00],0xfa
mov byte [ds:01],0x55
mov byte [ds:02],0x89
mov byte [ds:03],0xe5
mov byte [ds:04],0x1e
mov byte [ds:05],0xb8
mov byte [ds:06],0x00
mov byte [ds:07],0x00
mov byte [ds:08],0x8e
mov byte [ds:09],0xd8
mov byte [ds:10],0xb8
mov byte [ds:11],0x00
mov byte [ds:12],0x00
mov byte [ds:13],0x3e
mov byte [ds:14],0xa0
mov byte [ds:15],0x1e
mov byte [ds:16],0x04
mov byte [ds:17],0x1f
mov byte [ds:18],0x5d
mov byte [ds:19],0xfb
mov byte [ds:20],0xcf
mov ax,0
mov ds,ax
mov bx, 36 ;9x4=36
mov byte [ds:bx+0],0x00
mov byte [ds:bx+1],0xf0
mov byte [ds:bx+2],0x00
mov byte [ds:bx+3],0x00
The 21 bytes of hex are this:
Code: Select all
cli
push bp
mov bp,sp
push ds
mov ax,0
mov ds,ax
mov ax,0
mov al,[ds:0x041e]
pop ds
pop bp
sti
iret
1) where do I put the int9 program (that needs to install the ISR at boot time) in the tree of the MEATY SKELETON and how do I get it to run at boot time?
2) how do I pass the returned byte into the tree of the MEATY SKELETON? There is no variable name for the byte and no name or label for the program (ISR) that returns it. I have studied the MEATY SKELETON and I see the likely places to pass it in are in tty.c or putchar.c. There's no way to do:
extern void int9(char c) - because there's no label int9.
TIA. Bill S.