资源简介
一个操作系统的实现 全部源代码 于渊
代码片段和文件信息
/*************************************************************************//**
*****************************************************************************
* @file disklog.c
* @brief
* @author Forrest Y. Yu
* @date Thu Nov 20 16:22:45 2008
*****************************************************************************
*****************************************************************************/
#include “type.h“
#include “config.h“
#include “stdio.h“
#include “const.h“
#include “protect.h“
#include “string.h“
#include “fs.h“
#include “proc.h“
#include “tty.h“
#include “console.h“
#include “global.h“
#include “keyboard.h“
#include “proto.h“
#include “hd.h“
#include “fs.h“
#define DISKLOG_RD_SECT(devsect_nr) rw_sector(DEV_READ \
dev \
(sect_nr) * SECTOR_SIZE \
SECTOR_SIZE /* read one sector */ \
getpid() \
logdiskbuf);
#define DISKLOG_WR_SECT(devsect_nr) rw_sector(DEV_WRITE \
dev \
(sect_nr) * SECTOR_SIZE \
SECTOR_SIZE /* write one sector */ \
getpid() \
logdiskbuf);
/* /\***************************************************************************** */
/* * do_disklog */
/* *****************************************************************************\/ */
/* /\** */
/* * Perform syslog() system call . */
/* * */
/* * @return */
/* *****************************************************************************\/ */
/* PUBLIC int do_disklog() */
/* { */
/* char buf[STR_DEFAULT_LEN]; */
/* /\* get parameters from the message *\/ */
/* int str_len = fs_msg.CNT; /\* length of filename *\/ */
/* int src = fs_msg.source; /\* caller proc nr. *\/ */
/* assert(str_len < STR_DEFAULT_LEN); */
/* phys_copy((void*)va2la(TASK_FS buf) /\* to *\/ */
/* (void*)va2la(src fs_msg.BUF) /\* from *\/ */
/* str_len); */
/* buf[str_len] = 0; /\* terminate the string *\/ */
/* return disklog(buf); */
/* } */
/*****************************************************************************
* disklog
*****************************************************************************/
/**
* Write log string directly into disk.
*
* @param p Ptr to the MESSAGE.
*****************************************************************************/
PUBLIC int disklog(char * logstr)
{
int device = root_inode->i_dev;
struct super_block * sb = get_super_block(device);
int nr_log_blk0_nr = sb->nr_sects - NR_SECTS_FOR_LOG; /* 0x9D41-0x800=0x9541 */
static int pos = 0;
if (!pos) { /* first time invoking this routine */
#ifdef SET_LOG_SECT_SMAP_AT_STARTUP
/*
* set sector-map so that other files cannot use the log sectors
*/
int bits_per_sect = SECTOR_SIZE * 8; /* 4096 */
int smap_blk0_nr = 1 + 1 + sb->nr_imap_sects; /* 3 */
int sect_nr = smap_blk0_nr + nr_log_blk0_nr / bits_per_sect; /* 3+9=12 */
int byte_off = (nr_log
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1474560 2009-03-30 16:16 于渊操作系统光盘\chapter1\a\a.img
文件 661 2009-03-30 16:16 于渊操作系统光盘\chapter1\a\bochsrc
文件 563 2009-03-30 16:16 于渊操作系统光盘\chapter1\a\boot.asm
文件 1474560 2009-03-30 16:16 于渊操作系统光盘\chapter1\b\a.img
文件 661 2009-03-30 16:16 于渊操作系统光盘\chapter1\b\bochsrc
文件 821 2009-03-30 16:16 于渊操作系统光盘\chapter1\b\boot.asm
文件 81567 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\80m.img.gz
文件 1474560 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\a.img
文件 1000 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\bochsrc
文件 10018 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\boot\boot.asm
文件 2222 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\boot\include\fat12hdr.inc
文件 1552 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\boot\include\load.inc
文件 13873 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\boot\include\pm.inc
文件 29754 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\boot\loader.asm
文件 25149 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\fs\disklog.c
文件 6075 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\fs\li
文件 16086 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\fs\main.c
文件 3923 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\fs\misc.c
文件 11610 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\fs\open.c
文件 3777 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\fs\read_write.c
文件 2897 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\include\stdio.h
文件 979 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\include\string.h
文件 931 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\include\sys\config.h
文件 913 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\include\sys\console.h
文件 8289 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\include\sys\const.h
文件 4370 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\include\sys\fs.h
文件 1725 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\include\sys\global.h
文件 11657 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\include\sys\hd.h
文件 5124 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\include\sys\keyboard.h
文件 7831 2009-03-30 16:17 于渊操作系统光盘\chapter10\a\include\sys\keymap.h
............此处省略2748个文件信息
相关资源
- 温州大学操作系统课件温州大学操作
- 操作系统概念-第7版 清晰完整
- 嵌入式实时操作系统μC/OS-III-原版书
- 嵌入式实时操作系统μC/OS-III-原版书
- 未来教育2019年操作系统课件.pdf
- 嵌入式实时操作系统small RTOS51原理及
- 南京航空航天大学考研数据结构及操
- 操作系统:设计与实现第二版
- nachos 3.4线程+文件系统+虚拟内存实习
- 计算机操作系统(第3版)汤小丹 汤子
- 2016年辽宁大学分布式操作系统习题整
- 操作系统:设计与实现第三版下册
- 操作系统课程设计_模拟文件系统
- 加州伯克利大学操作系统 讲义
- 操作系统BIOS设计
- 操作系统概念英文版第七版.pdf
- Linux内核设计的艺术:图解Linux操作系
- 哈工大张英涛教授操作系统PPT课件
- 机器人操作系统浅析ROS肖军浩译
- 《自己动手写操作系统》光盘内容以
- 操作系统:精髓与设计原理高清第七
- 嵌入式操作系统基础μCOS-2和Linux(第
- 《操作系统考研辅导教程》
- 《操作系统真象还原》pdf
- 《计算机操作系统(第4版)汤小丹》
- 云南大学831数据结构与操作系统2003、
- 《老码识途-从机器码到框架的系统观
- 嵌入式操作系统风云录 历史演进与物
- 基于嵌入式实时操作系统的程序设计
- 2019版王道考研操作系统单科
评论
共有 条评论