Question: 4.10 Consider a system with two LCD message displays in the context of a preemptive thread schedulerwith blocking semaphores. To display a message, the OS

 4.10 Consider a system with two LCD message displays in the

4.10 Consider a system with two LCD message displays in the context of a preemptive thread schedulerwith blocking semaphores. To display a message, the OS can call either LCD1_OutString or LCD2_OutString passing it an ASCII string. These routines have critical sections but must run with interrupts enabled. The foreground threads will not call LCD1_OutString or LCD2_OutString directly; rather, the threads call a generic OS routine OS_Display. If an LCD is free,the OS passes the message to the free LCD. If both LCDs are busy, the thread will block. There are many threads that wish to display messages, and the threads do not care or know onto which LCD their message will be displayed. You are given the LCD1_OutString or LCD2_OutString routines, the OS and the blocking semaphores with the following prototypes. void LCD1_OutString(char *string); // up to 20ms to complete void LCD2_OutString(char *string); // up to 20ms to complete int OS_Init Semaphore(Sema4Type *semaPt, int16_t value); void OS_Wait(Sema4Type *semaPt); void OS_Signal(Sema4Type *semaPt); a) List the semaphores and private global variables needed for your solution. For each semaphore define what it means and what initial value it should have. Give the meaning and initial values for any private global variables you need. The threads will not directly access these semaphores or variables. b) Write the generic OS display routine that the foreground threads will call (you may not disable interrupts or call any other functions other than the five functions shown above) void OS_Display(char *string){ 4.10 Consider a system with two LCD message displays in the context of a preemptive thread schedulerwith blocking semaphores. To display a message, the OS can call either LCD1_OutString or LCD2_OutString passing it an ASCII string. These routines have critical sections but must run with interrupts enabled. The foreground threads will not call LCD1_OutString or LCD2_OutString directly; rather, the threads call a generic OS routine OS_Display. If an LCD is free,the OS passes the message to the free LCD. If both LCDs are busy, the thread will block. There are many threads that wish to display messages, and the threads do not care or know onto which LCD their message will be displayed. You are given the LCD1_OutString or LCD2_OutString routines, the OS and the blocking semaphores with the following prototypes. void LCD1_OutString(char *string); // up to 20ms to complete void LCD2_OutString(char *string); // up to 20ms to complete int OS_Init Semaphore(Sema4Type *semaPt, int16_t value); void OS_Wait(Sema4Type *semaPt); void OS_Signal(Sema4Type *semaPt); a) List the semaphores and private global variables needed for your solution. For each semaphore define what it means and what initial value it should have. Give the meaning and initial values for any private global variables you need. The threads will not directly access these semaphores or variables. b) Write the generic OS display routine that the foreground threads will call (you may not disable interrupts or call any other functions other than the five functions shown above) void OS_Display(char *string){

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!