From: Adam Dunkels (adam_at_sics.se)
Date: 2001-10-17 16:16:56
On Wednesday 17 October 2001 15:36, you wrote: > On Wed, 17 Oct 2001, Keates, Mark wrote: > > Forgive my non-familiarity of the C64 disk drive but > > how would the server running from its ROM know about > > the filesystem layout? > > Actually, the drive contains the disk operating system and does know about > the file system layout. But I'd adopt a simpler file system for such an > application, since the HTTP server does not need to write anything to the > disk (no log files). The file system could be implemented by one sector > that is initially loaded from the disk to memory. That sector would > contain file names and disk addresses (linear addressing, maybe with a > fixed interleave factor). > > Each page would occupy an integer amount of sectors, and each sector would > hold 256 bytes of data (instead of the normal 254). The end of a file > could be marked with a zero byte, or if you want to serve binary files, > the file lengths could be stored in the directory. In that case, the > starting disk address of a document could be determined by adding the file > lengths of preceding documents (rounded up to 256-byte boundaries) > together. I wouldn't adopt a new file system for such a web server for a number of reasons. First, it is much harder to write/modify a disk with a custom filesystem; it wouldn't be possible to use existing tools such as the 1541 ROM routines to do this. Second, the 1541 filesystem isn't that hard to work with - the directory layout is very simple. Third, the "next block" pointers in the data blocks are well suited for an application such as this since less connection state would have to be used. I.e., there would be no need to hold the length of the file that is being sent is when the "next block" pointer stuff is used. The fact that 254 bytes are used instead of 256 wouldn't really matter since the TCP maxium segment size (MSS, the number of bytes per TCP packet) would be configured to be well below 256 bytes anyway. I think the advantages of using the standard filesystem would outweigh the small savings that can be made by having a custom filesystem. /adam -- Adam Dunkels <adam_at_sics.se> http://www.sics.se/~adam ---------------------------------------------------------------------- To unsubscribe from the list send mail to majordomo_at_musoftware.de with the string "unsubscribe cc65" in the body(!) of the mail.
This archive was generated by hypermail 2.1.3 : 2001-12-14 22:05:43 CET