• 大小: 1.61MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-01
  • 语言: 其他
  • 标签: 哈工大  

资源简介

本人清理旧系统时整理出来的,包含了哈尔滨工业大学操作系统课程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个文件信息

评论

共有 条评论