Yep said:
I used this as an example
I am writing under 32 Bit Pmode in DOS, so
B8000 is correct (sorry for the off topicness), but the code will be used
to control peripherals with their MMAP'd space on the PCI bus.
yes, I was about to comment that one should be sure of this one.
there is always the risk of some or another newb trying to compile something
like this in windows or linux and wondering why it doesn't work...
now, this construct is funky in that it will neither work in a full 32-bit
OS, nor in real-mode, so (raw or DPMI) pmode is needed (taking as an
assumption that there are no compilers targeting big-real mode...).
My bad. I shouldnt have put '' but yes, the value of 3 in binary, not
ascii. But to be technically correct writing a word value of 0x7f50 will
put a capital 'P' in white text on grey background on the screen, a dword
value 0x7f507f50 will put 2 of them as the ordering is attrib,character.
now what is more fun is moving the cursor, and implementing the code for
pulling off the usual scrolling textual display.
actually, interesting and possible is to implement an IRC style interface,
where the commandline is always pinned to the bottom of the screen and text
starts at the bottom and moves up...
of course, the more traditional interface also works fairly well (and is a
little more flexible, and mixes better with our good old friend ANSI control
codes...). actually, at the time I had found a copy of the VT100 manual and
implemented nearly every applicable command...
later on, this project (a hobby OS), ended up using ModeX and VESA in place
of text mode (I think I had also started on a native driver for the S3
Virge...).
one noticable observation at the time was that video memory was a lot slower
than native memory, so it was faster to draw everything in a local buffer
and dump it to the screen (computers were not so fast back then).
eventually this project died because I decided it was pointless.
but, oh well...
There is a reason for it. I need to be able to write explicit 8, 16, 32
bit values to any address within the 32 bit address space. This is allowed
on the platform I am writing (32 Bit Pmode under DOS).
yeah...