I think microkernel significance (3) - object analysis zircon kernel

 Zircon is object-based kernel, user mode almost only by interacting with objects Handles resource OS, a Handle can be considered active and answer a range of OS-specific resource subsystem.

Zircon dynamic resource management are: processor time; memory and address space; device I / O memory; interruption; signal and wait.

Kernel objects provided by the application:

IPC

Channel; Socket; FIFO.

task

Process; thread; JoB; task.

signal

Events; events; Futex.

Memory and address space

Virtual memory objects; virtual memory address space; bus transaction initiator (Bus Transaction Initiator BTIs, indicates that the bus master / DMA capabilities of a device, the device may be used to impart the ability to access memory).

Wait: Port

Kernel objects drive ready

Break; resources; log

Kernel objects and LK

Some structures comprises a kernel object into a plurality of levels of LK, such as thread_t object contains a thread, and the channel is not the object of any object containing LK level.

Kernel object lifecycle

It is a kernel object reference count; most syscall generated by the kernel objects, the reference count is greater than 0 to stay alive, reference counting handle value outputted by the binding as a syscall. Handle object requires maintaining survival Handle attached to a table; Close Handle Handle is deleted from the table corresponding to the Handle (such as by sys_close ()), the kernel will also reduce the object's reference count. Generally, when the last kernel object associated with a closed Handle kernel object's reference count will be reset to 0, then the destructor will run kernel objects.

When the new Handle and (kernel) directly to create the object pointer will cause an increase in the reference count; therefore the life cycle of a kernel object may be longer than the process that created it.

scheduler

Kernel objects by a C ++ class, derived from the scheduler (the Dispatcher), coating method and its implementation. Therefore, the code can be found in the thread object thread scheduler (ThreadDispatcher), there are only concerned about the kernel object general sense a lot of code, this case can go to fbl :: RefPtr <Dispatcher> Find.

Kernel Object Security

原则上,内核对象没有对安全的固有概念,不做认证检查,安全权限由Handle持有,一个进程可以含有一个对象的两个不同权限的Handle。

发布了24 篇原创文章 · 获赞 3 · 访问量 2335

Guess you like

Origin blog.csdn.net/ytfy339784578/article/details/103946543