Friday 16 June 2017

Embedded

The memory layout in vxworks is known as flat physical address space.

How Vx Works differ from UNIX.?

VxWorks runs in one mode. No protected vs. user mode switching is done. Running in supervisor
mode on most processors, and not using traps for system calls.
UNIX provides resource reclamation; by default, VxWorks does not.
VxWorks does not have full "process"; it only has tasks, or "threads".


Task in Vx Works?
A task is a smallest unit of execution that can compete on its own for system resources .
It lives in a virtual insulated environment given by the kernel.


Difference b/w taskdelay and nanosleep ?
TaskDelay Wind vxworks puts a task in delayed state for specified ticks. To enable the R
ound robin scheduling using API kernelTimeSlice(int ticks).
Nanosleep posix : puts process in sleep for specified nano seconds.


Taskvariables?
To make a shared code as re-entrant use task variables.
If any global variable used in the code, in order to maintain a private copy of that variable with respect to a task,use taskvarAdd with that global variable. The changes made to the global variable in one task will not be reflected in other task




Which flags should be used to achieve priority inheritance and which option should be used with that flag
FLAG=SEM_INVERSION_SAFE
OPTION=SEM_Q_PRIORITY
SEM_Q_PRIORITY|SEM_INVERSION_SAFE
semMCreate(SEM_Q_PRIORITY|SEM_INVERSION_SAFE); 


How to achieve synchronization with out semaphore?
Using message queue with queue length of one,its called as mailbox 


How to achieve mutual exclusion with out semaphore?
Using taskLock() and taskUnlock() API 


What is critical/atomic section of the code
The part of the code, if manipulated leads to instability is called as critical or atomic section. The criticak section of the code can be written between entry(semTake(),taskLock()) and exit (semGive(),taskUnlock). 


 What makes os an rtos ?
- RTOS has to be multitasking and Preemptible
- The notion task priority has to exist
- Should support priority inheritance
- Algorithm and task synchronization
- OS behavior should be known
- Deterministic OS Behavior
( All Service Calls, Context Switching, Interrupt Latency )

- Full support from the vendor.

Multitasking :
each task has its "context" (priority, set of registers, stack area, program counter, timers)
"context switch" is a process of switching the processor between several tasks
each task can be in various states (waiting, ready, running, delayed, interrupted)

  
What does a task control block (TCB) consists  in VxWorks?
TCB contains everything the kernel needs to know about the task .
Name and status of the task Priority Task ID Remainder of time slicing
Context switching
information like
Task program counter
,SP, CPU register
I/O assignment, and
delay timer 


Related image 

GRUB(grand unified bootloader) just loads and execute the kernel and initrd images.
Kernel Execute the /sbin/init program since init is first program to executed the  by Linux Kernel, it has the process id (PID) of 1.
initrd stands for Initial RAM Disk. initrd is used by kernel as temporary root file system until kernel is booted and the real root file system is mounted.

  • Init identifies the default initlevel from /etc/inittab and uses that to load all appropriate program.
  • 0 – halt
  • 1 – Single user mode
  • 2 – Multiuser, without NFS
  • 3 – Full multiuser mode
  • 4 – unused
  • 5 – X11
  • 6 – reboot

 
  

No comments:

Post a Comment