tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: blocksizes



> So far I had one remaining question: the fsbtodb shift value.
> 
> With a a DEV_BSIZE addressed device you need a shift value
> that is unrelated to the physical sector size and does not
> change when you talk to a device or access an image file.
> 
> However, this makes the superblock incompatible with say FreeBSD
> which natively addresses the disk.
> If we keep fsbtodb compatible then we need to adapt the
> fsbtodb translation.
> 
> This is really the only place where native addressing
> helps FFS, but only FFS. However, storing the physical
> sector size in the filesystem (instead of using information
> from the driver) is what I consider questionable.

The design of FFS is independent from design of our buffercache(9)
or all disk drivers, so if FFS has its own "disk block size" value
in its superblock, we have to check and convert (or reject)
the "FFS disk block size value" for our native I/O size
whichever we will choose DEV_BSIZE or physical block size.
(fragment size -> FFS disk block size -> our I/O size)

Note lfs and ext2fs have the same issue.

FYI, Windows XP creates MBR in the first sector even on a removable
2KB/sec MO disk and it seems to use physical block numbers.
(though our fdisk(8) and mbrlabel(8) don't work on !512bytes/sec disks)
BPB also uses physical block numbers.

---
# dmesg | grep sd0
sd0 at scsibus0 target 0 lun 0: <KONICA, OMD-7062, 1.12> optical removable
sd0: fabricating a geometry
sd0: 606 MB, 151 cyl, 64 head, 32 sec, 2048 bytes/sect x 310352 sectors
sd0: fabricating a geometry
sd0: sync (100.00ns offset 15), 8-bit (10.000MB/s) transfers
# dd if=/dev/rsd0d bs=2048 count=2 | hexdump -Cv
 :
000001b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 ff  |................|
000001c0  ff ff 06 ff ff ff 01 00  00 00 4f bc 04 00 00 00  |..........O.....|
                ^^          ^^^^^^^^^^^^ ^^^^^^^^^^^
                type        start        size (0x04bc4f == 310351 sectors)

000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|

 :

00000800  eb 3c 90 4d 53 44 4f 53  35 2e 30 00 08 08 02 00  |.<.MSDOS5.0.....|
00000810  02 00 02 00 00 f8 26 00  3f 00 ff 00 01 00 00 00  |......&.?.......|
00000820  4f bc 04 00 00 00 29 dc  a5 88 cc 4e 4f 20 4e 41  |O.....)....NO NA|
00000830  4d 45 20 20 20 20 46 41  54 31 36 20 20 20 33 c9  |ME    FAT16   3.|

---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index