Hi Christos,
If you know the address of the physical location in the memory you could
use kernel functions such as:
bcopy, memcopy, memmove. ( or memscan, in case you know which character
you're scanning for. )
Alternatively, use "mmap" if you'd like to map a device to the User
address space and then read.
Your program can call these functions in the "user space" and needs not
be run as an rtl thread as mentioned in other responses to your e-mail.
However if you do decide to read an area of memory in the rtl space (not
in the Linux space), you need to structure your code to have an
init_module, a clean_up module and an rtl thread and then insert your
module into the running kernel using "insmod" which runs on top of some
other modules that get need to be inserted using "insrtl", see examples
by Michael and Victor. The one that is more directly related to your
question is "mmap" which was bundled as part of the rtlinux2.3. and
demonstrates how physical memory can be accessed from the RTL space.
Also note that mmap wont run from an rtl thread and has to be called
from the inti_module as explained in the README file in the mmap example
by Michael Barabanov.
Linux kernel internals by Beck and Linux Drivers by Rubini discuss the
subject extensively from a device driver developer's point of view.
Regards,
Emeel.
> Christos Tranoris wrote:
>
> Hello
>
> I would like to write an example program under RTL
> and I would like to access the status of NumLock for example.
> The status in dos is on a byt located on segment 0x0040 and offset
> 0x0017.
> As a new to RTL, how I can get this status under RTL?
> How I can read this byte at this address?
> any idea would be helpful.
>
> thank you in advance
>
> Christos
>
>
>
> ^~v~^~v~^~v~^~v~^~v~^~v~^~v~^~v~^~v~^~v~
> | Christos Tranoris (http://users.otenet.gr/~oggi/ )
> | Phd candidate
> | e-mail (1): [EMAIL PROTECTED]
> | e-mail (2): [EMAIL PROTECTED]
> | e-mail (3): [EMAIL PROTECTED]
> | e-mail (4): [EMAIL PROTECTED]
> | Electronics & Computing Sector
> | Electrical & Computer Engineering Dept.
> | University of Patras - 26500 RIO, PATRA, GREECE
> | "Don't worry,
> | I'll think of something." - INDY
> ^~v~^~v~^~v~^~v~^~v~^~v~^~v~^~v~^~v~^~v~
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/