Siêu thị PDFTải ngay đi em, trời tối mất

Thư viện tri thức trực tuyến

Kho tài liệu với 50,000+ tài liệu học thuật

© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

Thuc Hanh He Dieu Hanh 3 - ReadFloppyDisk.doc
MIỄN PHÍ
Số trang
2
Kích thước
79.2 KB
Định dạng
PDF
Lượt xem
895

Thuc Hanh He Dieu Hanh 3 - ReadFloppyDisk.doc

Nội dung xem thử

Mô tả chi tiết

THỰC HÀNH HỆ ĐIỀU HÀNH – BÀI 3

Mục tiêu : Tìm hiểu cách quản lý file và điã. Thực hành trên đĩa mềm 1.44Mb

Bài 1 :

/* The Boot sector on the floppy disk contains two things, namely, boot

parameters and the disk bootstrap program. The purpose of the disk

bootstrap program is to load DOS files from the disk into memory.

Whether the disk bootstrap program would be used or not depends on

whether the disk is being used for booting the computer or not. The

boot parameters are used by DOS at the time a read or write operation

is performed on the disk. This is because the boot parameters contain

the vital information about how the disk has been formatted. From

format to format the values of the boot parameters may change, but

their order remains same. The following program display boot parameters

of floppy.

*/

/* Display boot parameters of floppy */

# include "dos.h"

# include "stdlib.h"

# include "stdio.h"

# include "conio.h"

struct boot

{

unsigned char code[3] ;

unsigned char system_id[8] ;

int bytes_per_sec ;

char sec_per_clus ;

int res_sec ;

char fat_copies ;

int root_dir_entry ;

unsigned int no_sects ;

unsigned char format_id ;

int sec_per_fat ;

int sec_per_trk ;

int no_sides ;

int no_sp_res_sect ;

unsigned char rest_code[482] ;

} ;

main( )

{

struct boot b ;

char temp[4] ;

int val, drive ;

val = absread ( 0, 1, 0, &b ) ;

if ( val == -1 )

Tải ngay đi em, còn do dự, trời tối mất!