From: Frank K. <fbk...@zy...> - 2009-08-10 15:05:27
|
Zulfi Khan wrote: > I just tried to find the interrupt# in this topic and I got 1ch. Yeah... 1Ch is supposed to be a "secondary timer interrupt", and it's supposed to be "safer" than hooking int 8 itself. However, I couldn't get anything to happen, using 1Ch. Maybe it has to be "enabled"(???). I switched to hooking int 8... and presto, my clock started working (sorta). I really should go back and retry with int 1Ch. > I thought 8259 is irrelevant because its a separate IC. It is a separate IC, but it controls which interrupts get sent to the CPU, and which don't. At the end of an interrupt routine, we need to tell the PIC we're done. Instead of dealing with that, I "chained" the original int 8. Grab the original address *before* installing the new routine, and jump into it at the end of the new routine. This is a common technique to take care of the "housekeeping" that needs to be done. Maybe that's not the way you want to do it. Lots to experiment with! > Its prinnting garbage and F instaed of welcome kernel message. Yeah... maybe going to an .exe was a mistake. I re-worked both the bootsector and the "kernel" code to jump to 7E4h:0, and made cs, ds, and es the same - something more like a .com file (but not exactly). This seems to be working. I'd like to be able to use separate "segment code" and "segment data" - maybe even "segment stack stack". So far, I haven't been able to load such a thing successfully, so I stick to "everything in one segment". At least I'm seeing the welcome message... > I would try this again after reading what you have suggested. The attached "mz2.zip" started out being your code... I altered it quite a bit. Made "add_isr" a subroutine, rather than your "install" macro, and added a "get_old_isr" to capture the original isr. "mz3.zip" is an attempt to integrate this into the more "modular" version. The idea is that the routines - add_isr, get_old_isr, write, getkey,... - are supposed to be "C callable". I haven't actually tried this - I don't "do" C - that's your department! :) I added "hours" - no way this puppy is going to run over a hour, but I figured I ought to handle the possibility... I don't know if any of this crap will help you. It "sorta works", but isn't "right". The "clock" stays running in a "tight loop", but if I try to "getkey" for a delay, the whole thing locks up. So the only "command" that works is control-alt-delete. This indicates something seriously wrong with the way I've hooked the interrupt (I think). I haven't worked out what the problem is. Takes a lot of rebooting! I downloaded Bochs, but couldn't get it to compile - some symbol "not defined in this scope". In a pinch, I'll mess with C to get it to compile when it won't, but C++ is beyond me completely. Trying to install from the RPM resulted in the usual cascade of errors. So I'm stuck with a "real reboot" from a "real floppy"... which I generally prefer, but it's time-consuming! See of you can make anything out of it. Feel free to ask questions, but the answer will probably be "I dunno, that was the first thing that came into my head." :) Good Luck! Best, Frank |