473,804 Members | 3,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Some assitance please

Hello I was wondering if someone could please help me understand what I
need to do in order to get this project to work. I just need some hints
or a push in the right direction to get this to work, thanks.

Design the Array of Expected Events, AEE, required by the interrupt
system. Each entry
i, 0 <= i < 6, in this array contains three fields, AEE[i].IIC,
AEE[i].InterruptHandl er,
AEE[i].WaitingQueue. These elds are designed such that they can
accommodate the
following information:

a. AEE[i].IIC is used to identify the interrupt identification code of
the interrupt agents
that belong to the level i of interrupts. For this project the
interrupt identification
codes will be defined by a range of integers. This range of integers is
stored in
the AEE[i].IIC as an interval (i1; i2) where i1; i2 are positive
integers, i1 < i2. For
example, a potential situation could be: AEE[0].IIC = (0,20),
AEE[1].IIC = (21,23),
AEE[2].IIC = (24,34), AEE[3].IIC = (35,40), AEE[4].IIC = (40,44),
AEE[5].IIC =
(45,59). Assume that an interrupt at the level 0 having the interrupt
identification
code 10 would occur. Since 0 <= 10 <= 20, this agent is valid and would
activate the
Device Interrupt Handler AEE[0].InterruptHandl er which in turn would
print:

Interrupt Level: 0
Agent interrupting at level 0: 10
Prime numbers generated: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29

Note that you must choose interrupt identification codes integers in
the ranges from
the range 0-59. However, all identification code ranges must be
disjoint.

b. AEE[i].InterruptHandl er is the address of the "InterruptHandl er".
This field will be
implemented as a pointer to a C-function (returning type integer). An
appropriate
declaration of this field might be:

c. AEE[i].WaitingQueue is a FIFO queue that stores processes waiting
interrupts on
this level to arrive. Since processes that issue system calls generate
exceptions,
that is, they suspend themselves for an event, the AEE[5].WaitingQueue
is null.
However, these processes are identified by their agent number in the
integer interval
specified in AEE[5].IIC. When a process suspends itself by a system
call it is sent
in the queue of processes waiting for some other event to occur. That
is, the events
for which processes suspend themselves are the occurrences of other
interrupts.

In order to simulate the handling of the FIFO queues organized in
AEE[0].WaitingQueue,
AEE[1].WaitingQueue, AEE[2].WaitingQueue, AEE[3].WaitingQueue,
AEE[4].WaitingQueue,
when a system call interrupt occurs the process is sent in the waiting
queue AEE[AgentNumber
% 5].WaitingQueue where % is the modulo-operator in the C language.
This means
that interrupt handler for the system call in addition to the printing
of its number
and prime numbers as specified above will perform an operation
enqueue(ProcId,
AEE[AgentNumber % 5].WaitingQueue). The interrupt handler treating
inter-
rupts that arrive on the interrupt levels i, 0 <= i <= 4, will remove
processes from
their own interrupt waiting queues and will show that by printing:

Interrupt Level: i
Agent interrupting al level i: j
No processes is waiting in the AEE[i]. WaitingQueue

if their queues are empty, or

Interrupt Level: i
Agent interrupting al level i: j
Process ProcId was freed from the queue AEE[i].WaitingQueue

if the process "ProcId" is the first process waiting in that queue.

this is what I have started with

#include <stdio.h>
#define Size 6

typedef int (* InterruptHandle r)();

struct AEEEntry
{
int IIC;
InterruptHander IHA;
struct WaitingQueue *PWQ
}AEE[Size];

Mar 23 '06 #1
1 1782
al**********@ya hoo.com schrieb:
Hello I was wondering if someone could please help me understand what I
need to do in order to get this project to work. I just need some hints
or a push in the right direction to get this to work, thanks.
Your request looks like a homework question; have a look at
<http://www.clc-wiki.net/wiki/Introduction_to _comp.lang.c>
especially 2.1 and 2.2

Design the Array of Expected Events, AEE, required by the interrupt
system. Each entry
i, 0 <= i < 6, in this array contains three fields, AEE[i].IIC,
AEE[i].InterruptHandl er,
AEE[i].WaitingQueue. These elds are designed such that they can
accommodate the following information:
Translated to C, this means you want AEE to be an
"array 6 of sometype" where sometype is a structure with exactly
three members, IIC, InterruptHandle r, and WaitingQueue.
You _can_ do all of this with one declaration,
struct {
....
} AEE[6];
but it usually is a better idea to procede systematically.

#define AEE_SIZE 6
typedef struct {
....
} TExpectedEvent;

TExpectedEvent AEE[AEE_SIZE];

As soon as we know more about the members, we can fill the structure.
a. AEE[i].IIC is used to identify the interrupt identification code of
the interrupt agents
that belong to the level i of interrupts. For this project the
interrupt identification
codes will be defined by a range of integers. This range of integers is
stored in
the AEE[i].IIC as an interval (i1; i2) where i1; i2 are positive
integers, i1 < i2. For
example, a potential situation could be: AEE[0].IIC = (0,20),
AEE[1].IIC = (21,23),
AEE[2].IIC = (24,34), AEE[3].IIC = (35,40), AEE[4].IIC = (40,44),
AEE[5].IIC =
(45,59). Assume that an interrupt at the level 0 having the interrupt
identification
code 10 would occur. Since 0 <= 10 <= 20, this agent is valid and would
activate the
Device Interrupt Handler AEE[0].InterruptHandl er which in turn would
print:

Interrupt Level: 0
Agent interrupting at level 0: 10
Prime numbers generated: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29

Note that you must choose interrupt identification codes integers in
the ranges from
the range 0-59. However, all identification code ranges must be
disjoint.
Okay, so we need to represent unsigned integers in the range from 0
through 59. Nothing is said about how the interval is to be represented,
so we have some leeway there.
As we are at it with the structures, let us use one
typedef struct {
TIicBound Lower;
TIicBound Upper;
} TIicInterval;
We are still free to choose what type we do want to use.
For the time being, let us stick with an unsigned type, say
unsigned short or unsigned char.
typedef unsigned short TIicBound;

For extra brownie points, give the user access macros -- if
the user sticks to them, you can change the member names or
even the type of TIicInterval (e.g. to an array 2 of TIicBound)

#define GET_IIC_LOWER(i ic) ((iic).Lower)
#define SET_IIC_LOWER(i ic, l) ....
and so on.

This gives us the struct member IIC as
TIicInterval IIC;
b. AEE[i].InterruptHandl er is the address of the "InterruptHandl er".
This field will be
implemented as a pointer to a C-function (returning type integer). An
appropriate
declaration of this field might be:
Unfortunately, you omitted this information.
Note that "pointer to a function returning int" is not a really
sufficient type description. Without the list of parameter types
for such a function, you effectively deny yourself the benefits
of type checking.
Without clarification, the above description is useless.
Note: Declaring a function pointer type for functions returning
double and receiving no arguments, looks like this:
typedef double (*TFcnPtr)(void );
c. AEE[i].WaitingQueue is a FIFO queue that stores processes waiting
interrupts on
this level to arrive. Since processes that issue system calls generate
exceptions,
that is, they suspend themselves for an event, the AEE[5].WaitingQueue
is null.
However, these processes are identified by their agent number in the
integer interval
specified in AEE[5].IIC. When a process suspends itself by a system
call it is sent
in the queue of processes waiting for some other event to occur. That
is, the events
for which processes suspend themselves are the occurrences of other
interrupts.

In order to simulate the handling of the FIFO queues organized in
AEE[0].WaitingQueue,
AEE[1].WaitingQueue, AEE[2].WaitingQueue, AEE[3].WaitingQueue,
AEE[4].WaitingQueue,
when a system call interrupt occurs the process is sent in the waiting
queue AEE[AgentNumber
% 5].WaitingQueue where % is the modulo-operator in the C language.
This means
that interrupt handler for the system call in addition to the printing
of its number
and prime numbers as specified above will perform an operation
enqueue(ProcId,
AEE[AgentNumber % 5].WaitingQueue). The interrupt handler treating
inter-
rupts that arrive on the interrupt levels i, 0 <= i <= 4, will remove
processes from
their own interrupt waiting queues and will show that by printing:

Interrupt Level: i
Agent interrupting al level i: j
No processes is waiting in the AEE[i]. WaitingQueue

if their queues are empty, or

Interrupt Level: i
Agent interrupting al level i: j
Process ProcId was freed from the queue AEE[i].WaitingQueue

if the process "ProcId" is the first process waiting in that queue.

this is what I have started with

#include <stdio.h>
#define Size 6

typedef int (* InterruptHandle r)();
See my comments above.
This can be nasty if you have functions with prototypes in scope.

struct AEEEntry
{
int IIC;
InterruptHander IHA;
Please post actual code; this won't compile.
struct WaitingQueue *PWQ
}AEE[Size];


Well, I think I gave you enough help to get you started.
Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Mar 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2611
by: Az Tech | last post by:
Hi people, (Sorry for the somewhat long post). I request some of the people on this group who have good experience using object-orientation in the field, to please give some good ideas for topics to include in a course on object-orientation that I'm going to conduct. (I will later summarize all the replies and discussion, for the
4
1889
by: Joshua Goodstein | last post by:
Select d.* from ( select agent_addr, max(date_time) from eventlog where priority = 1 group by agent_addr) d, (select agent_addr, max(date_time) from eventlog where priority = 6 group by agent_addr) u where d.agent_addr = u.agent_addr and d.access_time >= u.access_time The above statement is to get certain data from an event table. I need
6
6331
by: mike | last post by:
Hello, After trying to validate this page for a couple of days now I was wondering if someone might be able to help me out. Below is a list of snippets where I am having the errors. 1. Line 334, column 13: there is no attribute "SRC" <bgsound src="C:\My Documents\zingwent.mids"> You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is...
193
9656
by: Michael B. | last post by:
I was just thinking about this, specifically wondering if there's any features that the C specification currently lacks, and which may be included in some future standardization. Of course, I speak only of features in the spirit of C; something like object-orientation, though a nice feature, does not belong in C. Something like being able to #define a #define would be very handy, though, e.g: #define DECLARE_FOO(bar) #define...
4
1286
by: Big Tony | last post by:
I'm going crazy trying to do something I think should be simple. Task: Windows service that will post a file to a WebServer automatically. I have created a form on the remote site. I can use IE and post to it. When I try to use System.Net.Webclient to post to the form, it does not work. No error is returned, but the file does not upload. Here is the code that is used to post.
5
2232
by: thatsMaBoy | last post by:
Hi, I am attempting to display a simple Javascript alert when a webpage loads. It works on some pages but not on others. For example, the following code does not produce an alert: Code in webpage1 (note, this is the only VB code in the ASPNET webpage, in other words, the rest is all HTML): Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
10
2154
by: sara | last post by:
Hi - I have a report that is 14 columnar sub-reports (Line up: Position- holders in each of our 14 locations - Manager, Assistant Manager, Receiving, Office, etc). I output directly to PDF (using ConvertReportToPDF from this site - Stephan Lebans) The formatting - Outlines on some fields - do not appear on subreports
4
15495
by: Michael | last post by:
I have a repeater web control. Currently I want to change some row's color based on defined condition. Is there any code sample demonstrating how to accomplish it? Thanks.
4
1312
by: muddasirmunir | last post by:
Well i want to make a simple website , for which i need some suggestion from you people. I have good idea about front page to make website but the tool not looking great so please suggest me some tool to make a website. i want to make catagories on left size and when user click on one catagory the results will be displayed on the page , as i want to increase catagories by time to time for this currently i am thinking of making frame but...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10337
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9160
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6854
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5654
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3822
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2995
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.