Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement a prototype list of process control block (PCB) in C language. Please follow the specifications below: Must use the headers given in the next

Implement a prototype list of process control block (PCB) in C language. Please follow the specifications below:

  • Must use the headers given in the next page. All you need has been given.

  • Must use malloc and sizeof to create new PCBs.

  • Must create and put 12 processes into the PCB list.

  • Your code must show the following information for each process.

Your complete C program should be no more than 120 lines (Excluding the headers in the next page)

Here is the example:

index of process: 7

addr_pcb = 400031c8

proc_id = 2

proc_class = 2

proc_priority = 2

proc_state = 0

Header file:

struct saved_regs{

double reg1,reg2,reg32,reg_pc;

};

struct pcb_type{

int proc_id;

int proc_priority;

int proc_state;

int proc_class;

struct saved_regs *reg_pt;

};

struct process_list{

struct pcb_type *pcb_pt;

struct process_list *who_follows;

};

struct process_list *start = NULL;

int allocated_id = 1;

int allocated_prio = 1;

int allocated_class = 1;

struct saved_regs *alloc_saved_regs ();

struct pcb_type *create_new_pcb ();

void add_new_process (struct pcb_type *);

Basically, build a C program that will create 12 mock processes, attach them to 'start' (in the header file), and prints this for each of the 12 processes:

Here is the example:

index of process: 7

addr_pcb = 400031c8

proc_id = 2

proc_class = 2

proc_priority = 2

proc_state = 0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases 28th British National Conference On Databases Bncod 28 Manchester Uk July 2011 Revised Selected Papers Lncs 7051

Authors: Alvaro A.A. Fernandes ,Alasdair J.G. Gray ,Khalid Belhajjame

2011th Edition

3642245765, 978-3642245763

More Books

Students also viewed these Databases questions