30.12.2013 Views

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2.7. MEMORY 15<br />

which the upper and lower distinction is to be made. In principle, however, the system attribute<br />

portion is assigned from the least significant bit (LSB) toward the most significant bit (MSB), and<br />

implementation-dependent attributes from the MSB toward the LSB. Bits not defining any attribute<br />

must be cleared to 0.<br />

In some cases an object may contain extended information. Extended information is designated when<br />

the object is registered. Information passed in parameters when an object starts execution has no effect<br />

on T-<strong>Kernel</strong> behavior. Extended information can be read by calling an object status reference system<br />

call.<br />

2.7 Memory<br />

2.7.1 Address Space<br />

Memory addressable space is distinguished as system space (shared space) or task space (user space).<br />

System space can be accessed equally by all tasks, whereas a task space is accessible only by the tasks<br />

belonging to it (see Figure 2.8). Multiple tasks may in some cases belong to the sametask space.<br />

The logical address space of task space and system space depends on the CPU (and MMU) limitations<br />

and is therefore implementation-dependent, but in principle task space should be assigned to low<br />

addresses and system space to high addresses.<br />

Logical addresses (examples)<br />

0x00000000<br />

0x3fffffff<br />

Task space<br />

#1<br />

Task space<br />

#2<br />

. . . Task space<br />

#n<br />

0x40000000<br />

0x7fffffff<br />

System space<br />

Figure 2.8: Address Space<br />

Since interrupt handlers and other task-independent software are not tasks, they do not have a task<br />

space of their own. Instead, while in a task-independent portion they belong to the task executing<br />

just before entering the task-independent portion. This is the same as the task space of the currently<br />

running task returned by tk get tid. When there is no task in RUN state, task space is undefined.<br />

T-<strong>Kernel</strong> does not create or manage address space. Normally T-<strong>Kernel</strong> is used along with a subsystem<br />

for handling address space management and the like.<br />

In a system with no MMU (or not using an MMU), essentially task space does not exist.<br />

2.7.2 Nonresident Memory<br />

Memory may be resident or nonresident.<br />

When nonresident memory is accessed, data is copied to that memory from a disk or other storage. It<br />

therefore requires complicated processing such as disk access by a device driver.<br />

Accordingly, when nonresident memory is accessed, the device driver, etc., must be in operational state.<br />

Access is not possible during dispatch disabled or interrupts disabled state, or while a task-independent<br />

portion is executing.<br />

Similarly, in OS internal processing, it is necessary to avoid accessing nonresident memory in a critical<br />

section. One such case would be when the memory address passed in a system call parameter points<br />

Copyright c○ 2002, 2003 by T-Engine Forum<br />

T-<strong>Kernel</strong> <strong>1.B0.02</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!