Floppy disk sector count
问题 I am trying to understand why lseek() is used in this image creator. Why 5 bytes away from start of file? If I changed that number, the OS won't boot. The image creator creates a .img file with the bootloader.bin inside. /* modify the sector count */ total_sector_number = file_size / 512 lseek(disk_image_fd, 5, SEEK_SET); write(disk_image_fd, &total_sector_number, 2); write(disk_image_fd, &kernel_32_sector_number, 2); //printf("%d\n", lawl); printf("TOTAL_SECTOR_NUMBER : %d\n", total_sector