简体   繁体   中英

How to read an inode table from an ext2 block group?

In writing an ext2 driver for my hobby OS, I ran into a problem reading the inode table from a block group descriptor.

The third field of the block group descriptor is the block ID of the inode table for that group. In my case for the root directory of my file system this comes back as 64. The superblock is located at block 1, which is 1024 bytes past the beginning of the volume. The block size is 1024 bytes, but my disk sector size is 512. So to access the superblock, I read from lba 2.

The problem is when I try to read the inode table. If it's block id is 64, and my block size is 1024 and disk sector size is 512, wouldn't I read the inode table from disk sector 130? I do that, but nothing is there...

What is the proper way to read an inode table given a valid block group descriptor?

块组描述符表中的块ID都是绝对的,因此在您的情况下,块ID 64将存储在LBA 128和129中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM