Hi,
[off topic]
My apoligies to all, as I've spent most of the last 2 days tracking down an annoying bug - isolating parts, searching through heaps of code, examining CPU detection and AP startup code, etc. I even rewrote all the video parts of my boot manager to work in 80 * 50 text mode (instead of 640 * 480 graphics mode) just to make sure the video code wasn't the problem (it seemed like the only thing that could have been the problem at one point).
After all of this I found the bug about an hour ago. Here it is:
Code: Select all
mov ecx,(256 * 2048) / 4 ;ecx = size of table in dwords
mov edi,BOOTMEMCPUdataTable
clr eax
cld
.l1: mov [gs:edi],eax
add edi,4
loop .l1
This loop is meant to fill a 512 KB table (which eventually contains information on each CPU detected) with zeros - can you see the bug?
In reality, this loop only clears 256 KB instead of 512 KB, which makes my OS think other CPUs are present if the computer/BIOS leaves data in the last half of the table (which is why the OS worked on almost all of my computers, and died in spectacularly confusing ways otherwise).
If you're still trying to see where the bug is, the loop instruction at the end is running in real mode and therefore uses CX instead of ECX.
[/off topic]
Anyway, I shall try to make amends, in order of newest to oldest.
Rob wrote:Anyway, what about a volume label? I think Windows needs it. Not 100% sure if it is really required though.
I'm not sure if any OS actually needs the volume label, but for floppy disks the file system needs a way to determine if the disk has been changed (for old/dodgy floppy drives where the "media changed" flag doesn't work). For this purpose I'll add a volume label and a time stamp (time when when the media was first formatted) - the chance of both being the same would be very small.
Rob wrote:- 1. It looks like it is a conscious decision to have only one date for a file. Perhaps it would be a good idea to have a create date as well? (I don't care for the access date which Windows also has, for example). That might be a piece of crucial information you want to give the receiver.
- 2.
For the directory entry type, all other fields in the index entry except for the entry name must be ignored when the entry is read and filled with zeros when the entry is being written
Shouldn't a directory have a (create, see point 1) modify date as well? I assume it can be renamed?
Most file systems have a creation time, a modification time and an accessed time, where the modification time is updated when the attributes change or when the file's data changes. On Linux, most people disable the "accessed time" to improve performance (not sure about other OSs). For example, my "/etc/fstab" begins with these 2 lines:
[tt]/dev/md0 / reiserfs noatime 0 1
/dev/sda1 /boot ext2 noatime 0 2[/tt]
This leaves the creation time and the modification time. The modification time is what you see when you type "ls" or "dir" or view the file's properties. It's also used by utilities (archivers, make, etc).
I can't think of any practical use for the creation time. At 8 bytes per timestamp having more than one isn't too efficient, especially for a simple file system that is meant used for transferring files (like FAT) rather than as an advanced native OS partition (like NTFS or ext3). DOS/FAT also only has the modification time.
[continued]