[컴퓨터운영체제] The HOST Dispatcher Shell
- 등록일 / 수정일
- 페이지 / 형식
- 자료평가
- 구매가격
- 2010.09.27 / 2019.12.24
- 27페이지 / docx (MS워드 2007이상)
- 평가한 분이 없습니다. (구매금액의 3%지급)
- 2,600원
최대 20페이지까지 미리보기 서비스를 제공합니다.
자료평가하면 구매금액의 3%지급!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
추천 연관자료
- 목차
-
목차
I. 프로그램 개요
1. Purpose of Project
2. Project Specification
II. Dispatcher의 구조
1. 메모리 & 리소스 할당
2. Dispatching(CPU 할당)
Ⅲ. 메모리 할당 알고리즘
1. First-fit Algorithm
Ⅳ. Multilevel Dispatching Scheme
1. Multilevel dispatching scheme
2. 메모리 할당 Scheme
3. 리소스 할당 Scheme
4. Schemes Used by Real-OS
5. 개선할 사항
Ⅴ. 실행 내용 및 결과
Ⅵ. 소스 코드
- 본문내용
-
Resource* leftResource = NULL; // allocate resource
mainMemory* mainMemory; //main Mem
char *filename;
qHeader* DispatchQueue; // Dispatch Queue
qHeader* UserJobQueue; // user job Queue
qHeader* RealTimeQueue; // Realtime Queue
qHeader* firstQueue; // priority is 1
qHeader* secondQueue; // priority is 2
qHeader* thirdQueue; // priority is 3
// make headers
DispatchQueue = makeHeader();
UserJobQueue = makeHeader();
RealTimeQueue = makeHeader();
firstQueue = makeHeader();
secondQueue = makeHeader();
thirdQueue = makeHeader();
//init resource
leftResource = (Resource*)malloc(sizeof(Resource));
leftResource->CDdriver = NUMOFCDROM;
leftResource->modem = NUMOFMODEM;
leftResource->printer = NUMOFPRINTER;
leftResource->scanner = NUMOFSCANNER;
//init mainMemory
mainMemory = getmainMemory(SIZE_OF_MEMORY);
if (args < 2) //show useage
{
printf("USAGE : hostd <filename>\n");
exit(0);
}else
filename = argv[1]; //filename
FILE *f = fopen(filename, "r"); //open
if (f == NULL) //can't open
{
printf("file open error\n");
exit(0);
}
// read job info. from list file
while(fscanf(f, "%d, %d, %d, %d, %d, %d, %d, %d\n",
&jobInfo[0], &jobInfo[1], &jobInfo[2], &jobInfo[3], &jobInfo[4], &jobInfo[5], &jobInfo[6], &jobInfo[7]) != EOF)
{
emptyPCB = makeNewPCB(); // make empty PCB
emptyPCB->args[0] = "./sigtrap"; // name of program
emptyPCB->args[1] = NULL; // for execvp(args[0], args)
emptyPCB->arrivaltime = jobInfo[0]; // arrival time
emptyPCB->firstPriority = jobInfo[1]; // priority
emptyPCB->currentPriority = jobInfo[1]; //
emptyPCB->leftTime = jobInfo[2]; // time left
emptyPCB->totalTime = jobInfo[2]; // total time for running
emptyPCB->memorySize = jobInfo[3]; // memory required
emptyPCB->resource->printer = jobInfo[4]; // printer
emptyPCB->resource->scanner = jobInfo[5]; // scanner
emptyPCB->resource->modem = jobInfo[6]; // modem
emptyPCB->resource->CDdriver = jobInfo[7]; // cdrom
enQueue(DispatchQueue, emptyPCB); // into dispatch Q
}
fclose(f); //finish reading file
//start dispatch
timer = 0;
while(1)
{
//If all queue are empty...
if(((emptyPCB = checkQueue(DispatchQueue)) == NULL) &&
((emptyPCB = checkQueue(RealTimeQueue)) == NULL) &&
((emptyPCB = checkQueue(UserJobQueue)) == NULL) &&
((emptyPCB = checkQueue(firstQueue)) == NULL) &&
((emptyPCB = checkQueue(secondQueue)) == NULL) &&
((emptyPCB = checkQueue(thirdQueue)) == NULL) &&
(runningUPCB == NULL)) break;
// job dispatching
// movePCB :: from RealTimeQueue to UserJobQueue
while((movePCB = checkQueue(DispatchQueue)) != NULL){
// process arrives
if(movePCB->arrivaltime <= timer){
movePCB = deQueue(DispatchQueue); // dequeue
// check priority
// to real time queue
if(movePCB->firstPriority == 0){
enQueue(RealTimeQueue,movePCB);
}
//to user job queue
else if(movePCB->firstPriority <= 3 || movePCB->firstPriority >= 1) {
enQueue(UserJobQueue,movePCB);
}else
break;
}else
break;
} //finish dispatching
//resource and memory allocation for User Process
while((tempPCB = checkQueue(UserJobQueue)) != NULL )
{
//check resource and memory
if(isEnoughMemory(mainMemory, tempPCB) && checkResource(leftResource, tempPCB)){
//there are enough resources and memory for process
movePCB = deQueue(UserJobQueue);
//allocate memory and resource
movePCB->allocatedMemory = memoryAllocate(mainMemory,movePCB);
자료평가
-
아직 평가한 내용이 없습니다.
오늘 본 자료
더보기
최근 판매 자료
- 구심력측정_결과레포트_(2023)건국대_A+
- 실험(1)디지털 논리회로 프로젝트 Door-Lock 설계
- 백신개발 개요, 종류, 원리 및 개발과정 [코로나,코로나19,COV19,바이러스,백신,코로나바이러스,Vaccine]
- [제약공학] 난용성 약물 가용화 방법(Solubilization of non-soluble drug)
- 뉴턴의 법칙에 대하여 설명하시오
- [환경공학] 실내 공기 중 총부유세균 측정방법(충돌법)
- [유체역학]레이놀즈수 측정실험
- [인간공학] 키보드작업에서의 인체측정학- 키보드의 거리, 높이, 각도에 따른 타자수변화
- 다단식 연속증류 실험 결과레포트
- [LVDS] 액정 디스플레이
저작권 관련 사항 정보 및 게시물 내용의 진실성에 대하여 레포트샵은 보증하지 아니하며, 해당 정보 및 게시물의 저작권과 기타 법적 책임은 자료 등록자에게 있습니다. 위 정보 및 게시물 내용의 불법적 이용, 무단 전재·배포는 금지됩니다. 저작권침해, 명예훼손 등 분쟁요소 발견시 고객센터에 신고해 주시기 바랍니다.