How to read what's in the industry boat a floppy disk?
|
Use the DOS debug utility for this. You can take the opportunity to see an example from the boat using the command:
-l address disk sector number
then use address = c700, disk = 0, sector = 0,
number = 1 to request the reading of the first sector of the diskette and place it in the position c700 of memory from the current segment. The command w debug does the reverse operation (writes a block of memory to a sector of the disk:
-w address disk sector number
Note that the boat recorded by DOS has a block of information after the first 3 bytes of the sector. And the program bypasses this block by placing an instruction jmp early on.
|
What does the NTLDR missing error message mean when I insert the floppy to boot? |
It means that you formatted the floppy with Windows NT and that you did not install your boat loader. The NT always records a sector of boat standard warning that the floppy disk is not boat. The same is true for other Windows and DOS when you don't format the floppy with a system.
|
I'm having problems trying to allocate memory, however small the memory segment that I try to allocate the function returns saying that there is not enough memory. Would that be a limitation of .com programs? As I understand it, I need to allocate memory to create the buffer in the loader intaller, I was also trying to allocate memory to create an FCB, since it is easier to determine the file size through FCB´s. |
In neither program will it be mandatory to allocate memory. Remember that buffer = variable. Then you just have to declare the variable with the size needed for the buffer. For example, if you want to declare a 210-byte variable, use:
variable resb 210
|
One of our tasks is to develop a program to be installed in the boot sector of the floppy disk that has the functionalities
described in the work script. Is it my impression or should this program have a maximum of 512 bytes to fit completely in this sector? If the answer is negative, where should I install the rest of the program? In the following sectors? |
Really the boat it is only 512 bytes long and will only accept a program of up to 510 bytes (remember that the last two bytes contain the signature of the sector to show that it is executable). If your program fits in 510 bytes, better for you. The BIOS will load it directly when the computer boat. But if it is bigger than that, you should break it into two or more pieces and record it in different sectors. But the BIOS will continue to load only the first one,
then you should also create a routine (which should be in the first sector) that loads the other sectors into memory and executes them as needed.
|
How should I end my program?
|
Your program must not end. To restart the computer, use the reset.
|
My program works perfectly on the command line, but when I write to the boat it does not work.
|
This question is very general, use the
checklist below:
- Check that the floppy disk is ok. Use the command "l c700 0 0 1"inside the debug to read the disk sector. If it fails, it could be a floppy problem;
- Make sure you have changed the address of orgof your .asm file. Remember that the policy org it only informs the assembler that the program will be loaded in another memory location but does not generate any extra instructions. A .com program generated for an address other than 0x100 may not run correctly on the DOS command line;
- Remember that when the computer starts running the boat, only the CS and IP registers have valid values. You must define initial values for all other registers (through instructions in the program), mainly for segment registers (SS, ES and DS) and for stack registers (BP and SP).
|
Is it necessary to type the name of the file to be installed from the command line or is it enough to define it inside the .ASM file itself?
|
Just put it inside the .ASM itself. Don't forget to specify this in the report.
|