资源简介
本人清理旧系统时整理出来的,包含了哈尔滨工业大学操作系统课程8次实验的源代码及实验报告的整合版(除了实验七没有找到,但可以在本人的资源http://download.csdn.net/detail/ertwer12/1935717中下到实验七的单独版)。
注意:此次整理出来的这个资源中,包含了三个不同版本的实验八代码和报告,其中有两个是包含内核态线程的完整实验八。这是以前发的资源中所没有的。另外,打包的其他六个实验(包括代码和报告)都和本人之前上传的单独的实验资源不是一个版本,代码、报告和注释都有不同。
最后,切勿抄袭,小心被‘雷’,消化吸收,拿为己用。
代码片段和文件信息
/*
* linux/tools/build.c
*
* (C) 1991 Linus Torvalds
*/
/*
* This file builds a disk-image from three different files:
*
* - bootsect: max 510 bytes of 8086 machine code loads the rest
* - setup: max 4 sectors of 8086 machine code sets up system parm
* - system: 80386 code for actual system
*
* It does some checking that all files are of the correct type and
* just writes the result to stdout removing headers and padding to
* the right amount. It also writes some system data to stderr.
*/
/*
* Changes by tytso to allow root device specification
*/
#include /* fprintf */
#include
#include /* contains exit */
#include /* unistd.h needs this */
#include
#include
#include /* contains read/write */
#include
/*
* Changes by falcon to define MAJOR and MINOR for they
* are not defined in current linux header file linux/fs.hI copy it from
* include/linux/fs.h directly.
*/
#ifndef MAJOR
#define MAJOR(a) (((unsigned)(a))>>8)
#endif
#ifndef MINOR
#define MINOR(a) ((a)&0xff)
#endif
#define MINIX_HEADER 32
#define GCC_HEADER 1024
#define SYS_SIZE 0x3000
/*
* Changes by falcon to let this kernel Image file boot
* with a root image file on the first hardware device /dev/hd1 hence you
* should prepare a root image file and configure the bochs with
* the following lines(please set the ... as suitable info):
* ...
* floppya: 1_44=“Image“ status=inserted
* ata0-master: type=disk path=“/path/to/rootimage.img“ mode=flat ...
* ...
*/
#define DEFAULT_MAJOR_ROOT 3
#define DEFAULT_MINOR_ROOT 1
/* max nr of sectors of setup: don‘t change unless you also change
* bootsect etc */
#define SETUP_SECTS 4
#define STRINGIFY(x) #x
void die(char * str)
{
fprintf(stderr“%s\n“str);
exit(1);
}
void usage(void)
{
die(“Usage: build bootsect setup system [rootdev] [> image]“);
}
int main(int argc char ** argv)
{
int icid;
char buf[1024];
char major_root minor_root;
struct stat sb;
if ((argc != 4) && (argc != 5))
usage();
if (argc == 5) {
if (strcmp(argv[4] “FLOPPY“)) {
if (stat(argv[4] &sb)) {
perror(argv[4]);
die(“Couldn‘t stat root device.“);
}
major_root = MAJOR(sb.st_rdev);
minor_root = MINOR(sb.st_rdev);
} else {
major_root = 0;
minor_root = 0;
}
} else {
major_root = DEFAULT_MAJOR_ROOT;
minor_root = DEFAULT_MINOR_ROOT;
}
fprintf(stderr “Root device is (%d %d)\n“ major_root minor_root);
if ((major_root != 2) && (major_root != 3) &&
(major_root != 0)) {
fprintf(stderr “Illegal root device (major = %d)\n“
major_root);
die(“Bad root device --- major #“);
}
for (i=0;i if ((id=open(argv[1]O_RDONLY0))<0)
die(“Unable to open ‘boot‘“);
if (read(idbufMINIX_HEADER) != MINIX_HEADER)
die(“Unable to read header of ‘boot‘“);
if (((long *) buf)[0]!=0x04100301)
die(“Non-Min
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1563 2009-12-03 01:02 操作系统实验_几乎完整,包含第8次内核代码\report
文件 5144 2009-10-25 02:27 操作系统实验_几乎完整,包含第8次内核代码\实验一\bootsect.s
文件 5326 2009-10-25 09:18 操作系统实验_几乎完整,包含第8次内核代码\实验一\build.c
文件 7631 2009-10-25 05:40 操作系统实验_几乎完整,包含第8次内核代码\实验一\setup.s
文件 10240 2012-03-25 18:03 操作系统实验_几乎完整,包含第8次内核代码\实验一\操作系统实验报告一.doc
文件 1089 2012-03-25 18:05 操作系统实验_几乎完整,包含第8次内核代码\实验一\操作系统实验报告一.txt
文件 1113 2009-10-25 19:48 操作系统实验_几乎完整,包含第8次内核代码\实验一\操作系统实验报告一.txt~
文件 0 2012-03-25 18:13 操作系统实验_几乎完整,包含第8次内核代码\实验七的好像找不到了,可以去本帐户的单独资源里下,不过不是本人做的
文件 4436 2009-11-12 19:07 操作系统实验_几乎完整,包含第8次内核代码\实验三\exit.c
文件 3985 2009-11-12 19:07 操作系统实验_几乎完整,包含第8次内核代码\实验三\fork.c
文件 5367 2009-11-12 19:07 操作系统实验_几乎完整,包含第8次内核代码\实验三\main.c
文件 1979 2009-11-12 19:05 操作系统实验_几乎完整,包含第8次内核代码\实验三\printk.c
文件 1592 2009-11-12 19:07 操作系统实验_几乎完整,包含第8次内核代码\实验三\process.c
文件 2788 2009-11-12 19:07 操作系统实验_几乎完整,包含第8次内核代码\实验三\report.txt
文件 9752 2009-11-12 19:07 操作系统实验_几乎完整,包含第8次内核代码\实验三\sched.c
文件 4890 2009-11-12 23:47 操作系统实验_几乎完整,包含第8次内核代码\实验三\实验三_好像是测试时所用\1.txt
文件 544 2009-11-12 23:42 操作系统实验_几乎完整,包含第8次内核代码\实验三\实验三_好像是测试时所用\linux-0.11\boot\bootsect
文件 924 2009-11-12 23:42 操作系统实验_几乎完整,包含第8次内核代码\实验三\实验三_好像是测试时所用\linux-0.11\boot\bootsect.o
文件 5059 2008-08-28 13:14 操作系统实验_几乎完整,包含第8次内核代码\实验三\实验三_好像是测试时所用\linux-0.11\boot\bootsect.s
文件 27776 2009-11-12 23:42 操作系统实验_几乎完整,包含第8次内核代码\实验三\实验三_好像是测试时所用\linux-0.11\boot\head.o
文件 5938 2008-08-28 13:14 操作系统实验_几乎完整,包含第8次内核代码\实验三\实验三_好像是测试时所用\linux-0.11\boot\head.s
文件 344 2009-11-12 23:42 操作系统实验_几乎完整,包含第8次内核代码\实验三\实验三_好像是测试时所用\linux-0.11\boot\setup
文件 596 2009-11-12 23:42 操作系统实验_几乎完整,包含第8次内核代码\实验三\实验三_好像是测试时所用\linux-0.11\boot\setup.o
文件 5362 2008-08-28 13:14 操作系统实验_几乎完整,包含第8次内核代码\实验三\实验三_好像是测试时所用\linux-0.11\boot\setup.s
文件 4023 2008-08-28 13:14 操作系统实验_几乎完整,包含第8次内核代码\实验三\实验三_好像是测试时所用\linux-0.11\fs\bitmap.c
文件 10440 2009-11-12 23:42 操作系统实验_几乎完整,包含第8次内核代码\实验三\实验三_好像是测试时所用\linux-0.11\fs\bitmap.o
文件 1422 2008-08-28 13:14 操作系统实验_几乎完整,包含第8次内核代码\实验三\实验三_好像是测试时所用\linux-0.11\fs\block_dev.c
文件 6576 2009-11-12 23:42 操作系统实验_几乎完整,包含第8次内核代码\实验三\实验三_好像是测试时所用\linux-0.11\fs\block_dev.o
文件 9126 2008-08-28 13:14 操作系统实验_几乎完整,包含第8次内核代码\实验三\实验三_好像是测试时所用\linux-0.11\fs\buffer.c
文件 13532 2009-11-12 23:42 操作系统实验_几乎完整,包含第8次内核代码\实验三\实验三_好像是测试时所用\linux-0.11\fs\buffer.o
............此处省略607个文件信息
- 上一篇:CANape快速入门33962
- 下一篇:计算机图形学直线画圆多边形
相关资源
- 哈工大形式语言与自动机历年试题
- 鲁棒控制-哈工大姚郁
- 重大软院操作系统实验三:线程同步
- linux操作系统 基于内核模块的进程信
- 广工操作系统实验报告
- 哈工大社会计算与信息检索研究中心
- openswan的Pluto源码分析以及linux的IPse
- NDSwood R4内核
- 重大软院操作系统实验二:线程调度
- 广工操作系统实验报告文档+代码+可执
- 高速无槽永磁电机设计要点 哈工大
- 东北大学软件学院操作系统实验报告
- 《MIT JOS Lab1: Booting a PC》实验代码
- 哈工大形式语言考题03 08
- 《寒江独钓:Windows内核安全编程》源码
- 操作系统实验 7种进程调度算法的实现
- 北邮操作系统实验报告
- 哈工大离散数学课后习题答案
- 深度Linux 15.8下安装RTL8192EU驱动,亲测
- linux内核分析实验 模拟宾馆房间预订
- 机器学习的课件哈工大
- linux系统移植嵌入式linux系统:内核、
- kindle touch5.3.2内核镜像
- 信息安全概论复习课件
- 哈工大王义和近世代数答案
- 哈工大编译原理词法分析实验报告
- Eclipse 搭建ARM Lniux 内核驱动开发环境
- 如意腾讯X5内核浏览器类库.rar
- 《深入理解Linux内核》英文原版kindl
- 哈工大数理逻辑2018.zip
评论
共有 条评论