floppy

Reading more sectors than there are on a track with int 13h

偶尔善良 提交于 2020-12-11 08:55:16
问题 What is the order int 13h with ah=02h will read 19 sectors starting at (C, H, S) = (0, 0, 1) provided a (floppy) disk geometry of 2 heads, 18 sectors per track and 80 tracks per side. Or, more generally, what happens when it reaches the end of track 0, head 0? Does it go to track 1 or head 1? Does it even work properly in this case? EDIT: Wait.. is this actually like hours, minutes, seconds? If we reach the end of the track (S is greater than 18), then H is increased? 回答1: Modern BIOSes

Reading more sectors than there are on a track with int 13h

China☆狼群 提交于 2020-12-11 08:54:03
问题 What is the order int 13h with ah=02h will read 19 sectors starting at (C, H, S) = (0, 0, 1) provided a (floppy) disk geometry of 2 heads, 18 sectors per track and 80 tracks per side. Or, more generally, what happens when it reaches the end of track 0, head 0? Does it go to track 1 or head 1? Does it even work properly in this case? EDIT: Wait.. is this actually like hours, minutes, seconds? If we reach the end of the track (S is greater than 18), then H is increased? 回答1: Modern BIOSes

Assembly: Unable to read sectors after the first track

有些话、适合烂在心里 提交于 2020-07-03 05:27:09
问题 As part of my operating system I wrote this read sector function. It takes a sector address to read from a BIOS device id. But when I set to read from sector 19 (Head: 0, Track: 1, Sector 2) the result at 0x1000:0x0000 is likely past that sector (I checked that several times with a hex viewer). Also, when I read more than one sector, so that sector 19 is included, at the address mentioned above, I can read sector 19 which is copied at 0x1000:(512*19) without a problem. void __NOINLINE

Floppy disk sector count

☆樱花仙子☆ 提交于 2020-01-05 08:21:48
问题 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

Floppy disk sector count

泪湿孤枕 提交于 2020-01-05 08:21:22
问题 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

Develop a Bootloader In Assembly

走远了吗. 提交于 2020-01-01 13:57:53
问题 I've already done a part of my OS in Assembly, but now I want to build a own bootloader for it too instead of using GRUB. When I was developing my test OS in Assembly I remember that I boot it like this: org 0x7c00 bits 16 ; OS Kernel Here times 510 - ($-$$) db 0 dw 0xAA55 This I've already know. Now I want to use this and execute the "real" OS that will be a *.bin file written to the 2nd sector of the floppy. Then I want to know somethings How can I do a bootloader in Assembly to execute

How do I write a bin file (512 bytes) to the first sector (sector 0) of a floppy disk?

白昼怎懂夜的黑 提交于 2019-12-28 04:04:37
问题 How do I write a .bin file to be in the first sector of a floppy disk/virtual floppy disk/floppy image? I'm trying to boot a simple 512-byte bootloader. The size on everywhere says "512 bytes" so I should be good already. Additional Information: The bootloader simply displays a string, and I'm learning simple assembly. Some of the work is made in Windows and some in Ubuntu 14.04 (Trusty Tahr) (if this matters). It doesn't boot even though it has the bootloader sign. 回答1: If you are on Linux

create a virtual floppy image without mount? [closed]

不想你离开。 提交于 2019-12-17 22:24:47
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . There are a lot of posts to show to create a virtual floppy image file as a super user or users can run sudo command. The basic steps are: create empty 1.44MB image file by dd command format the image file by mkfs.msdos mount the image file to some mount point copy something to the mount point umount the virtual

IRQ 6 floppy disk controller interrupt not triggered

拜拜、爱过 提交于 2019-12-11 07:00:03
问题 For some reason, IRQ 6 never hits in my Qemu, Bochs, VMWare, or VirtualBox emulators. Do I need some type of virtual Floppy Drive or something? Here is my IRq6 handler: void i86_flpy_irq (struct regs *r) { //! irq fired _FloppyDiskIRQ = 1; printf("IRQ 6 HIT"); } It never says "IRQ 6 HIT", and not only that, in my install function for my irq6 where I call in kernel: void flpydsk_install (int irq) { //! install irq handler install_handler_irq (irq, i86_flpy_irq); //! initialize the DMA for FDC

Develop a Bootloader In Assembly

放肆的年华 提交于 2019-12-04 09:30:21
I've already done a part of my OS in Assembly, but now I want to build a own bootloader for it too instead of using GRUB. When I was developing my test OS in Assembly I remember that I boot it like this: org 0x7c00 bits 16 ; OS Kernel Here times 510 - ($-$$) db 0 dw 0xAA55 This I've already know. Now I want to use this and execute the "real" OS that will be a *.bin file written to the 2nd sector of the floppy. Then I want to know somethings How can I do a bootloader in Assembly to execute what will be starting on the 2nd sector of the floppy? I need to add anything to the Assembly source that