分享
 
 
 

Baby Cow File System - Draft 2005/09/05

王朝other·作者佚名  2006-02-01
窄屏简体版  字體: |||超大  

Baby Cow File System

Draft 2005/09/05

Design principles:

1. Assume CHS are 24 bits long, so each link is 3 bytes long, only max 8 GB hard disk is supported. Really don’t know how to control a larger hard disk by using port : (

2. Stable is the most important, second is speed. So my file system is atomic, either the operation is fully complete, or it is not. There is an atomic field, which is 4096 bytes long, when you write anything to the partition, backup the original block to that field first. !!! This will highly decrease the performance because write 1 block, it performs 2 write operations. !!! ReiserFS said they do it the same way, but they have better algorithm to fix this performance problem, if anyone know it, please tell me : )

3. My file system is not journal, but it is safety enough for single read/write operation.

4. I will not put all the field too tight, that mean even the field is 1 bit width, I will make it occupies 1 byte because I don’t want to perform &/| operation to retrieve the byte, it waste the CPU clock.

Feature will be added late:

1. Map a directory of file to a memory

2. Better permission format, more suitable to my operating system.

Baby Cow file system specification

Number of file within a directory

16777216

Number of sub directory

16777216

Maximum file size

2^64 / 16777216 TB

Maximum filename

500 single byte character

Maximum directory name

500 single byte character

Maximum partition size

8GB

Block size

4096 byte

Hard disk layout

Super block

Atomic field

Any other block

4096 Bytes

4096 Bytes

Excess bytes in the partition

Super Block: 4096 Bytes long, used to store the information of the partition. It must be located in the first 4096 bytes of the partition.

Byte Offset

0

2

502

510

518

526

528

536

Name

ID

Partition Name

Root directory link

Create time

Last modified time

Block Size in KB

Number of Free address Block

Unused

Width

2

500

8

8

8

2

8

3560

Example value

‘S’,’B’

“partition name”

LBA

Second since AD 2000

Second since AD 2000

4 (for 4096KB block size)

4 (for 4 blocks)

-

Descriptions:

1. Root directory list link, link to the block of root directory of partition, 24bit CHS value.

Free Address Block: there can be many free address list block, depend on the size of the partition, but these blocks must be following the super block.

Byte Offset

0

3

Name

ID

Free Block List

Width

3

Block size - 3

Example value

‘F’,’A’,’B’

Figure 1

Byte Offset

0

4

Width

1

8

Example value

0 : free

1 : used

LBA

(Figure 1)

Directory Block : used to store the information of the directory and the links to its sub-directory.

Byte Offset

0

3

503

506

509

518

526

534

542

Name

ID

Directory Name

Number of File

Number of Directory

Permission

Create time

Last modifed time

Directory indirect block

File/Directory links

Width

3

500

3

3

9

8

8

8

Block size - 542

Example value

‘D’,’I’,’R’

“/root/password”

52

64

rwx-rw-rw

Second since AD 2000

Second since AD 2000

Block ID

Figure 2

Descriptions:

1. Sub-directory/file link : each 4-bytes represent as follow:

ID

LBA

0 (File)

Block ID

1 (Directory)

Block ID

(Figure 2)

Directory Indirect Block

Byte Offset

0

3

Name

ID

File/Directory links

Width

3

Block size - 542

Example value

‘D’,’I’,’B’

Figure 2

File Block : used to store the information and content of the file.

Byte Offset

0

4

504

513

521

529

537

Name

ID

Filename

Permission

Create time

Last modifed time

Filesize

File Content Block

Width

4

500

9

8

8

8

Block size - 537

Example value

‘F’,’I’,’L’,’E’

“/root/a/b.txt”

rwx-rw-rw

Second since AD 2000

Second since AD 2000

20

Block ID

File Content Block : 4096 Bytes long, used to store the information and content of the file.

Byte Offset

0

Name

File Content

Width

4096

Example value

-

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有