⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nvr.c

📁 这是一个同样来自贝尔实验室的和UNIX有着渊源的操作系统, 其简洁的设计和实现易于我们学习和理解
💻 C
字号:
#include "all.h"#include "mem.h"#include "io.h"#include "ureg.h"#include "dosfs.h"static Dosfile file;static int opened;char nvrfile[128] = "plan9.nvr";static voidnvopen(void){	int s;	Dosfile *fp;	if(opened)		return;	opened = 1;	s = spllo();	fp = dosopen(&dos, nvrfile, &file);	splx(s);	if(fp == 0)		panic("can't open %s\n", nvrfile);}intnvread(int offset, void *a, int n){	int r, s;	nvopen();	s = spllo();	file.offset = offset;	r = dosread(&file, a, n);	splx(s);	return r;}intnvwrite(int offset, void *a, int n){	int r, s;	nvopen();	s = spllo();	file.offset = offset;	r = doswrite(&file, a, n);	splx(s);	return r;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -