The 'C' language does access hardware directly, and is the most common
language for doing so. (I'm a professional real-time software engineer; been
enjoying this discussion from the sideline ;/) In 15+ years, I've never
used anything but 'C' or variants (or assembler) to program hardware.
#define SOME_PERIPHERAL_ADDRESS 0xBADBADBA
//now shove some bits into that peripheral
*(SOME_PERIPHERAL_ADDRESS)= 0x03;
// or read from it...
volatile uint* peripheral_address= SOME_PERIPHERAL_ADDRESS;
uint8_t peripheral_read= *peripheral_address; // assuming an 8-bit data
size, 32 bit address size
This works assuming your operating system allows you to address memory
directly- most OS's usually restrict that to kernel drivers. Don't remember
if DOS does, never used it for anything.
For a project like this I would consider 'ucos', read 'micro-cos'. It's an
open source deterministic real-time OS ported to a wide variety of intel
systems. If your DOS variant isn't intended for real-time work, it is likely
not deterministic, and will also likely have an imprecise scheduler.
--Kenny A.
http://websites.expercraft.com/kennya/
Thanks for the tips Kenny. I'll research RT Linux for direct access to
memory.
I am not against using a different OS so I will also take a look.
micro cos.
----------------------------------------------------------
As far as I can tell micro cos does not run on PC mother
boards. Probably due to the dynamic ram requiring refresh.
I am not sure if that is done by the processor or the BIOS.
If it is the BIOS one might be able to find a BIOS
that supported static ram. Static ram is available
for PC mother boards.
Paul Lamar
On a normal motherboard Dynamic RAM refresh is often (always) handled
by the chipset.. The parameters for running the DRAM are usually
saved in the BIOS. At boot time, the chipset gets these parameters.
I believe the upkeep of the DRAM is essentially completely hidden from
the processor. The processor asks for the (block of) data (starting)
at a particular address and then either waits for it (not likely
because of the relatively huge latency of DRAM) or goes off to do
other things until the chipset tells the processor that the data is
available. There's more to it than that on a modern processor (cache,
pipeline, etc), but that's the basic idea.
Matt-
Thanks Matt. That actually sounds encouraging as the parameters
for static ram are more favorable for real time so the
chip set won't make the processor wait.
Paul Lamnar
Yes.. I wouldn't recommend dealing with DRAM unless you have to. I
think it's only useful for a big operating system running lots of
programs at the same time. SRAM and FLASH are much more useful for
what you are trying to do.
Matt-
--
The Rotary Engine NewsLetter. Powered by Linux.
ACRE NL web site.
http://www.rotaryeng.net
Youtube key word UTUBPLEASE
Copyright 1998-2009 All world wide rights reserved.