IO Simulation

Name

IO Simulation -- Simulation of the device

Synopsis


gint        init_IO_simulation              (void);
gint        IO_algorithm_event              (io_request_t *request);
gint        get_IO_head_pos                 (void);
io_queue_t  get_IO_reading_queue            (void);
void        set_IO_reading_queue            (io_queue_t new_reading);
io_queue_t  get_IO_requested_queue          (void);

Description

This functions serve to manage the disk's simulation and it's data structures.

Details

init_IO_simulation ()

gint        init_IO_simulation              (void);

initialices the IO simulation code.

Returns : nothing important.


IO_algorithm_event ()

gint        IO_algorithm_event              (io_request_t *request);

Insert a new request in the IO subsystem using the current algorith.

Mainly passes request over to the current algorithm and puts it the the queue of requested blocks.

request : request to be inserted.
Returns : nothing important.


get_IO_head_pos ()

gint        get_IO_head_pos                 (void);

Returns : the track number over which the head is currently flying.


get_IO_reading_queue ()

io_queue_t  get_IO_reading_queue            (void);

Get all pending requests as ordered by the current algoritym.

Returns : the request's "reading" queue (ordered by the current algorithm).


set_IO_reading_queue ()

void        set_IO_reading_queue            (io_queue_t new_reading);

Sets the request's "reading" queue.

This function should be called when ever the reading queue is modified by external means, even if the pointer to the queue is not changed.

new_reading : newly ordered "reading" queue.


get_IO_requested_queue ()

io_queue_t  get_IO_requested_queue          (void);

Get all pending requests in order of arrival.

Returns : the request's "requested" queue (in chronological ordered).