Learning how to write on the hard disk with INT 13H

In this post, you read about my experience in learning how to write on the hard disk with INT 13H. I did a lot of practice about reading the hard disk with INT 13H in the chapter III, and I was looking for an experiment that I could use to learn how to write with INT 13H. In the beginning, I thought about writing a completely new file on disk which involved writing a lot of entries all around the file system (FAT Tables, ROOT Directory, initialize and write a cluster). In the end, I realized how this was just way too complicated for my skill level so that I decided to try something different. Then I had a second idea: write on disk just to rename the volume label. I knew that the volume label was a special entry in the ROOT directory (see Fig. D of the post "It is time to look into FAT") so I felt confident to be able to find that special entry and change it on the hard disk. If I succeeded, then I had to see the change of the volume label directly in the Windows XP once rebooted.

I made my plan, and I decided to create some service procedures to be used by the main procedure volume_rename.

  • show_string_II: you know show_string already, but I decided to update it a little bit for reasons that I am going to write in the dedicated post to it.
  • write_ASCII: which is a new cast I did for the procedure "convert register in string" (CREG_STR).
  • Test INT 13H: I had to repeat the check for INT 13H done in the past1 to gather more information from the BIOS.
  • read_write_LBA: which is a wrapper around the bios INT 13H that I did to automatize and standardize certain aspects of the read and write action.
  • volume_rename: which is the final main procedure that performs the task.

In the upcoming posts, I am going to describe all the steps from realization and testing of the service procedures until I renamed the volume label of the partition D:\.

Comments