summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md51
-rw-r--r--bochsrc2
-rw-r--r--kernel/kernel.c1
3 files changed, 53 insertions, 1 deletions
diff --git a/README.md b/README.md
index f3be90c..0bd2a18 100644
--- a/README.md
+++ b/README.md
@@ -116,6 +116,57 @@ REFERENCES
MY NOTES BELOW THIS LINE
========================
+Keyboard Driver
+---------------
+
+//some thoughts on redesign of the keyboard driver
+//use uint8_t for proc_pos and buff_pos and a BUF_SIZE of 256 for auto wrap!?
+
+// kb input ringbuffer
+#define BUF_SIZE 256
+kb_scancode kb_buff[BUF_SIZE];
+
+buff_pos=0;
+proc_pos=0;
+buffered=0;
+
+void kb_irq()
+{
+ cli
+
+ //we get one interrupt for EACH scancode!
+ kb_scancode val=get_scancode();
+
+ // think about race condition if called while inside kb_proc();
+ if(buffered+1<BUF_SIZE)
+ {
+ kb_buff[buff_pos]=val;
+ buff_pos++;
+ buffered++;
+ }
+ else
+ {
+ //kb ring buffer is full;
+ }
+ sti
+
+}
+
+
+void kb_proc()
+{
+ if(proc_pos!=buff_pos)
+ {
+ kb_scancode val=kb_buff[proc_pos];
+
+ proc_pos++;
+ buffered--;
+
+ stdin(scancode_to_char(val));
+
+ }
+}
+
Linux Startup x86
-----------------
~ ontogeny recapitulates phylogeny ~
diff --git a/bochsrc b/bochsrc
index d733635..732b716 100644
--- a/bochsrc
+++ b/bochsrc
@@ -283,7 +283,7 @@ vga: extension=vbe
# The optional parameter 'write_protected' can be used to control the media
# write protect switch. By default it is turned off.
#=======================================================================
-floppya: 1_44=/home/miguel/_int/dev/FoolOs/FoolOS.img, status=inserted
+floppya: 1_44=./FoolOS.img, status=inserted
#floppya: image=../1.44, status=inserted
#floppya: 1_44=/dev/fd0H1440, status=inserted
#floppya: 1_2=../1_2, status=inserted
diff --git a/kernel/kernel.c b/kernel/kernel.c
index f4c9653..16028fd 100644
--- a/kernel/kernel.c
+++ b/kernel/kernel.c
@@ -20,6 +20,7 @@ void int_test_handler()
X86_IRQ_BEGIN
scr_put_string("inside software interrupt handler 88");
+ sleep(30);
X86_IRQ_END