lupher said:
Why shouldn't it be? I thought that's a standard. I recall taking a
class on OS and hardware, and I think it's the video card who simply
compies the whole screen from there to the screen using DMA.. Not
complitely sure about it, but I think that's what we were talking about,
so that CPU doesn't get involved and waste time for the whole thing.
So, you think your code is running on the video card? Far-out system,
man. My code runs on my lamp.
Ok, but how would a library like curses read and write from/to the
screen? There should be a way..
No, there shouldn't; at least, not without such I/O being gated by the
kernel.
I was thinking maybe I should try doing
it through int 10h.. Although first I'll have to figure out how to
insert asm code into c++ programs
I think I've figured out what you meant by "hardware interrupt 10,"
thanks to this site (thank you Google):
http://www.cs.umbc.edu/courses/unde...t/tech_help/BIOSandDOS_Interrupts.html#int10h
FYI, "10h" isn't a standard hardware interrupt, it's a BIOS interrupt.
Unless you're hacking your kernel, kiss your BIOS interrupts goodbye,
and good riddance. The equivalent in Linux is a request to the kernel,
known as a "system call," which manifests itself as a call to a C function.
Most processors won't let you write to addresses you don't own because
your code is not "privileged," meaning the chip is not in a sufficiently
"privileged mode." The kernel is privileged because it was loaded
specially when your system was started. If you want your code to run in
a privileged mode, you basically have to write your own kernel (or hack
the existing one). You are more than welcome to try these options. Try
Googling for "boot loader."
Anyway, it sounds like you are very familiar with a particular
programming environment. Unfortunately, that particular environment is
generally deemed "crappy." Since you are running Linux now, you have
access to a truck-load more functionality than you probably realize.
So, here's my advice:
1) Forget basically every low-level detail you've learned about your
system. You don't need to know any of that anymore.
2) Learn to write programs that rely only on standard C++, or whatever
subset is offered by the best compiler available to you. It's okay to
cheat a little by using bash scripts to call your programs in particular
ways, e.g. in a graphical terminal emulator.
3) When you want to do something not provided by the C++ standard
library, find an existing library to do it for you. If you have trouble
compiling it (as you did with Curses), track down the problems in the
code and fix them yourself. Notify the maintainer of the library of
what you did and why.
4) When you need some functionality not found in any existing library
for your system, and you can't adapt a library from a different system
to meet your needs, try writing a new library yourself. Put it under an
open-source license like GPL, and make it available to others. Post an
announcement about it in one of the "comp.your.system.announce" news groups.
5) When you're really stuck trying to make your system do what you want,
post questions to a news group that has specific expertise about your
platform, e.g. the comp.os.linux family.
6) When you want to discuss the C++ language, post here.
Good luck,
Jeff