操作系统设计与实作报告.doc
上传人:qw****27 上传时间:2024-09-12 格式:DOC 页数:10 大小:222KB 金币:15 举报 版权申诉
预览加载中,请您耐心等待几秒...

操作系统设计与实作报告.doc

操作系统设计与实作报告.doc

预览

在线预览结束,喜欢就下载吧,查找使用更方便

15 金币

下载此文档

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

操作系统设计与实作报告主题:Signal成员:吴正敏陈信瑜张简光哲郭闵嘉李俊岳卢颖志林胜尉背景UNIX中有几种历史悠久的处理程序间通讯机制(IPC、Inter-processcommunication),Signal是其中之一。系统核心利用Signal来通知处理程序某些事件发生了。使用者通常利用Signal来放弃执行某个处理程序或将交谈式的程序切换到某个状态。所以说Signal是softwareinterrupts。Signal很早就有了,像早期的Unix版本,不过那时有提供的Signal并不可靠(像Version7),直到4.3BSD和SVR3做了一些改变,加入了reliablesignals。可惜的是两者彼此并不相容。但幸运的,POSIX.1有提供了标准化的signal函式。Signal的编号在不同的UNIX版本有不同的设定,表一是Linux的编号方式,大致是合乎POSIX的标准。表一:Signal表列SingalnameNumberFunctionSIGHUP1hangupSIGINT2interruptSIGQUIT3quitSIGILL4illegalinstructionSIGTRAP5tracetrapSIGABRT6abort(generatedbyabort(3)routine)SIGIOT6Input/OutputTrap(obsolete)SIGBUS7buserrorSIGFPE8arithmeticexceptionSIGKILL9kill(cannotbecaught,blocked,orignored)SIGUSR110user-definedsignal1SIGSEGV11segmentationviolationSIGUSR212user-definedsignal2SIGPIPE13writeonapipeorothersocketwithnoonetoreaditSIGALRM14alarmclockSIGTERM15softwareterminationsignalSIGTKFLT16SIGCHLD17childstatushaschangedSIGCONT18continueafterstopSIGSTOP19stop(cannotbecaught,blocked,orignored)SIGTSTP20stopsignalgeneratedfromkeyboardSIGTTIN21backgroundreadattemptedfromcontrolterminalSIGTTOU22backgroundwriteattemptedtocontrolterminalSIGURG23urgentconditionpresentonsocketSIGXCPU24cputimelimitexceeded(seegetrlimit(2))SIGXFSZ25filesizelimitexceeded(seegetrlimit(2))SIGVTALRM26virtualtimealarm(seegetitimer(2))SIGPROF27profilingtimeralarm(seegetitimer(2))SIGWINCH28windowchanged(seetermio(4)andwin(4S))SIGIO,SIGPOLL29I/Oispossibleonadescriptor(seefcntl(2V))SIGPWR30PowerFailure(forUPS)SIGUNUSED31数据结构structtask_struct{/*thesearehardcoded-don'ttouch*/volatilelongstate;/*-1unrunnable,0runnable,>0stopped*/longcounter;longpriority;unsignedlongsignal;unsignedlongblocked;/*bitmapofmaskedsignals*/unsignedlongflags;/*perprocessflags,definedbelow*/interrno;longdebugreg[8];/*Hardwaredebuggingregisters*/structexec_domain*exec_domain;/*variousfields*/structlinux_binfmt*binfmt;structtask_struct*next_task,*prev_task;structtask_struct*next_run,*prev_run;unsignedlongsaved_kernel_