GEOS was not a DOS as such; it was more of a real OS that happened to include disk acceleration capability. However, I do love its VLIR files. I was strongly considering making a similar library to implement VLIR file capabilities in Linux using portable C, albeit with support for more than 127 records per file.
Just an idea: a CP/M alike OS for the 6502?
daivox wrote:
No, I don't like o65 format. I know someone will ask, "Why don't you just use o65+luna+lupo+lld for everything?" I am of the opinion that it's an unnecessary burden to use a generic executable format that is designed to accomodate multiple 8-bit processors and operating systems when I can make a better format that will cut down on the size of the dynamic linking loader a lot. Just wanted to cut that one off before it comes up. 
Quote:
I can't think of a single disk operating system for the 64 off the top of my head, unless GEOS counts.
GEOS was not a DOS as such; it was more of a real OS that happened to include disk acceleration capability. However, I do love its VLIR files. I was strongly considering making a similar library to implement VLIR file capabilities in Linux using portable C, albeit with support for more than 127 records per file.
daivox wrote:
Where can one find more information on VLIR? I have been curious for 10 years, but never actually found out what made it such a special thing.
Prepare . . .
A VLIR file is essentially an array of sequential files. There is a central sector (256 bytes), which was treated as an array of two-byte pointers (itself consisting first of a track byte then a sector byte) -- thus, the array had 128 elements in it. This was set in stone.
Element 0 was, traditionally, a link to another sector continuing the chain of sectors making up the array. However, it was never used, and GEOS itself didn't support it in any commercially available release. Therefore, it was always set to $00,$00.
Elements 1 through 127 were used as pointers to normal CBM-DOS-style sequential files. These are referred to as records. Because each record was organized as a unique sequential file, each could be a different length (hence, Variable Length Indexed Records, or VLIR). Note that VLIR records did not have corresponding CBM-DOS directory entries. For this reason, you must never use CBM-DOS's V command (to validate / fsck / chkdisk the disk), because all allocated sectors not belonging to a normal CBM-DOS file entry will be marked as free. You must always use GEOS to validate the disk, which is aware of VLIR files innately.
Code: Select all
Index Sectors
(Pointed to by CBM-DOS'
directory entry)
+---------------------+
| ......... |
| Standard GEOS |
| File Header |
| ......... |
+---------------------+
+$00 | Next Block (unused) |
+---------------------+ +------+ +------+ +------+ +------+
+$02 | Record 0 pointer |------->| Next |--->| Next |--->| Next |--->| 0,0 |
+---------------------+ +------+ +------+ +------+ +------+
+$04 | Record 1 Pointer | | .... | | .... | | .... | | .... |
+---------------------+ +------+ +------+ +------+ +------+
| ........ |
+---------------------+
+$FE | Record 126 Pointer |
+---------------------+
kc5tja wrote:
I remember AmigaOS blasting away 20fps to 30fps, full-screen video, reading it in from floppy, in near real-time (in particular, I'm referring to Space Ace game, as shipped on floppy). It was obviously compressed on the disk, which made for faster I/O. Still, no other computer at the time could touch this level of performance. Of course, today things are much different.
kc5tja wrote:
Of course, I worked for Amiga, Inc. after Commodore disbanded, so I am biased.
kc5tja wrote:
That being said, I was doing some research on RiscOS (BTW, no matter what Linux distribution I use, I always make it a point: the #1 thing I compile is ROX-Filer) a while ago, and was quite deeply impressed. The only thing that bummed me out was the decision to use cooperative multitasking instead of preemptive. Other than that, it looked like a really nice environment.
http://www.worldofwibble.com/images/riscos/rs-3.jpg
kc5tja wrote:
Going back to MOS and related topics, I am curious to learn what would happen if you issued the wrong filesystem. For example, supposing you have a volume ADFS::MyVolume with a file called data/txt in the root directory, what would happen if you issued CDFS::MyVolume.$.data/txt as a filename to work with?
Thanks.
Thanks.
Anyway back to sleep
cseemeuk wrote:
*choke* Acorn ARM prototype ... this was in 1987, on an 8MHz CPU with 1Mb of RAM and was realtime 3d with multi channel sound:
Quote:
It's a shame that RISCOS didn't get over the US in any knowledgeable quantity.
Too bad Irving Gould went all retarded on Tramiel. If I ever see Irving Gould in person, I'll rip his private parts off and stuff 'em down his throat. He built the company, then threw it all away. I just don't understand it. Sorry, I'm venting.
Quote:
After all it was Acorn that invented the ARM processor because they weren't happy with moving to the 65c816.
http://www.stanford.edu/~thierry1/ti99/assembly.htm -- one of the few places on the Internet where you'll find real meaty information on the chip.
Quote:
I still like the simplicity of the 65xxx series though which is why I'm here. It does the job 
Quote:
Ironically cooperative multi-tasking is great.
Quote:
File would not be found. Basically the filesystem is contained within CDFS or ADFS modules, so it'd ask the respective module to return the file.
Quote:
You know, it's funny -- I am sticking with the 65816 for the Kestrel designs (my own homebrew 8/16-bit computer design, which I hope to bring up to the level at least of the Apple IIgs if not further, but being fully openly documented and GPLed), but I was thinking of a different homebrew line after the Kestrel potential was exhausted that was based on the ARM architecture.
I'I'm going to attempt to build a Forth CPU from TTL one day. Should keep me busy for a couple of years.
Quote:
Gotcha. In that case, I must question the use of all the special syntax then. Why not just express a filename using a fixed template, like /filesystem/volume/dir/dir/dir/file?
cseemeuk wrote:
I'I'm going to attempt to build a Forth CPU from TTL one day. Should keep me busy for a couple of years.
I would like to revisit the homebrew CPU at some point as well. Discrete HC/AC TTL components just adds to the mystique. However, I would also like to play with FPGAs too, not only for Forth CPU research, but also to make a clone of the TMS9900, just so I can play with a 33MHz 9900 with single-cycle bus access (no, I have NO intention to replicate the abomination that is TI-99/4A).
But this is starting to veer wildly off-topic. I recommend PMing me for further responses to this sub-thread.
After reading through a few papers on how Plan 9 supports every major system service via a true filesystem interface (making Unix look pathetically archaic in comparison). And, I got to thinking: Commodore had Plan 9 beat by 10 or more years. There were only two things that were critically lacking, and one not-really-quite-so-critical thing.
First, in Commodore's kernel (sorry, but I refuse to use the CBM-misspelt name
), all I/O is performed over a byte-stream service. This is precisely the same interface as Plan 9. This is theoretically the same class of service that Unix also offers, but over time, Unix (instead of making use of special control files like Plan 9 does) introduced such meta-operations as ioctl(), fctl(), sockopt(), etc. In both the Commodore and the Plan 9 universes, this is done using special control files.
I therefore did some research on the Commodore Kernel, and found out that there were only ten or so kernel functions that were truely "portable" (in the sense that you could implement them on virtually any microprocessor). Of these, however, only six require any significant porting effort (by which, I mean having to spend more than two hours writing the code for the new platform): OPEN, CLOSE, CHKIN, CHKOUT, CHRIN, and CHROUT. The remainder are utility functions such as CLALL that are so trivial to port that they don't require any significant porting effort.
It is also interesting that these functions assume all devices are GPIB devices. And, it just so happens that all of them are vectored through RAM, thus allowing for future capabilities (like, mapping devices 32-63 to a second IEEE-488 bus, for example). Well, what happens if we define a pseudo-device 255 such that it's filename space happens to be a generic, hierarchial namespace?
I am attempting to implement such an extension now, and it's being defined for the Commodore 64 for the time being. I suspect that it would be easy to port to the +4, Commodore 128, and for that matter, even a PET or VIC-20. This new subsystem is called Colonel.
Initial estimates indicates that Colonel can fit in 2KB of space or less, not including dynamic data (like device node structures), thus making it viable also for an unexpanded VIC-20. Barely.
I'm writing the sources using noweb, a literate programming tool. This will therefore allow me to fully document the internal structure of the software in a way that no other Commodore documentation has been able to provide in the past. Indeed, looking at the Linux sources sure isn't helpful in determining how its VFS system is implemented. The book that will result from this will be very enlightening. English only, I'm afraid, as I'm only English literate.
I posit, therefore, that the Commodore Kernel already makes an ideal "BIOS" of sorts for a standard, 6502-targeted CP/M-like operating system. All that needs to really be written is a replacement for BASIC which serves as the command-line shell.
For those platforms which do not have the Commodore Kernel in place already, let it be known that the overwhelming majority of the Commodore Kernel functions are related to either the screen editor, or to hardware specific functionality (e.g., IEEE-488 or IEC buses, reading/writing the VDC chip in the Commodore 128 and B-series computers, etc). Therefore, they're relatively rarely used, and the programs that do use them make obvious assumptions about the underlying hardware. Thus, we can claim that the Commodore Kernel really consists only of OPEN, CLOSE, CHKIN, CHKOUT, CHRIN, CHROUT, CLALL, SETNAM, SETLFS, and maybe even READST. The rest are user interface amenities or utility functions to help with lower level I/O facilities (e.g., bit-banging the serial IEC bus). With so few core functions, it should be quite possible to "port" the Kernel to other 6502 platforms easily. Thus, as with CP/M, the "BIOS" (kernel) is implementation dependent, while the BDOS and other layers on top of it are relatively portable.
Anyway, enough background. The basic idea in Colonel is the implementation of a hierarchial, uniform namespace with support for installable device drivers that run locally on the machine. This flat space is assigned pseudo-device 255. For example, here is a simple hypothetical BASIC 2.0 program that makes use of the mouse (assumes Colonel and a mouse driver are already loaded):
Colon is used instead of the slash since CBM-DOS lets slashes appear in filenames. I didn't use a comma because, as with VMS, the comma appears to be used to append options to specific arguments (e.g., OPEN 1,8,1,"COLONEL,P,W").
Anyway, you get the idea. Drivers are selected based on longest match of the given filename. The filename is available in its entirety for the driver to examine (for example, the driver itself may be bound only to DEVS:MOUSE, treating the :0 suffix as a parameter for something -- in this case, which port the mouse would be hooked into).
This should work also with LOAD and SAVE as well. In fact, a better form of directory support should be implementable with yet another special driver:
could be used to get a directory listing of what's currently inside the DEVS directory.
Since the C64 lacks any concept of "current directory," it follows that all paths specified are inherently anchored at the Colonel's root namespace. Therefore, there is no need for a leading colon (contrast with Unix, where to specify an absolute path, you need to specify the leading slash). Support for "current directories" shouldn't be too hard to implement, but at this stage of the game, I don't yet see any need for it.
Just giving an update on my rationale and thinking processes. I'll update here once I finish Colonel to a point where it's usable.
First, in Commodore's kernel (sorry, but I refuse to use the CBM-misspelt name
I therefore did some research on the Commodore Kernel, and found out that there were only ten or so kernel functions that were truely "portable" (in the sense that you could implement them on virtually any microprocessor). Of these, however, only six require any significant porting effort (by which, I mean having to spend more than two hours writing the code for the new platform): OPEN, CLOSE, CHKIN, CHKOUT, CHRIN, and CHROUT. The remainder are utility functions such as CLALL that are so trivial to port that they don't require any significant porting effort.
It is also interesting that these functions assume all devices are GPIB devices. And, it just so happens that all of them are vectored through RAM, thus allowing for future capabilities (like, mapping devices 32-63 to a second IEEE-488 bus, for example). Well, what happens if we define a pseudo-device 255 such that it's filename space happens to be a generic, hierarchial namespace?
I am attempting to implement such an extension now, and it's being defined for the Commodore 64 for the time being. I suspect that it would be easy to port to the +4, Commodore 128, and for that matter, even a PET or VIC-20. This new subsystem is called Colonel.
Initial estimates indicates that Colonel can fit in 2KB of space or less, not including dynamic data (like device node structures), thus making it viable also for an unexpanded VIC-20. Barely.
I posit, therefore, that the Commodore Kernel already makes an ideal "BIOS" of sorts for a standard, 6502-targeted CP/M-like operating system. All that needs to really be written is a replacement for BASIC which serves as the command-line shell.
For those platforms which do not have the Commodore Kernel in place already, let it be known that the overwhelming majority of the Commodore Kernel functions are related to either the screen editor, or to hardware specific functionality (e.g., IEEE-488 or IEC buses, reading/writing the VDC chip in the Commodore 128 and B-series computers, etc). Therefore, they're relatively rarely used, and the programs that do use them make obvious assumptions about the underlying hardware. Thus, we can claim that the Commodore Kernel really consists only of OPEN, CLOSE, CHKIN, CHKOUT, CHRIN, CHROUT, CLALL, SETNAM, SETLFS, and maybe even READST. The rest are user interface amenities or utility functions to help with lower level I/O facilities (e.g., bit-banging the serial IEC bus). With so few core functions, it should be quite possible to "port" the Kernel to other 6502 platforms easily. Thus, as with CP/M, the "BIOS" (kernel) is implementation dependent, while the BDOS and other layers on top of it are relatively portable.
Anyway, enough background. The basic idea in Colonel is the implementation of a hierarchial, uniform namespace with support for installable device drivers that run locally on the machine. This flat space is assigned pseudo-device 255. For example, here is a simple hypothetical BASIC 2.0 program that makes use of the mouse (assumes Colonel and a mouse driver are already loaded):
Code: Select all
10 PRINT "{clrhome}CLICK ON [QUIT] TO EXIT."
20 Q=0:REM QUIT INDICATOR
30 OPEN 1,255,0,"DEVS:MOUSE:0"
40 IF Q<>0 THEN GOTO 90
50 INPUT#1,X,Y,B
60 PRINT "{home}{down}X=";X;"Y=";Y;"B=";B
70 IF B<>0 THEN Q=1
80 GOTO 40
90 CLOSE 1
Anyway, you get the idea. Drivers are selected based on longest match of the given filename. The filename is available in its entirety for the driver to examine (for example, the driver itself may be bound only to DEVS:MOUSE, treating the :0 suffix as a parameter for something -- in this case, which port the mouse would be hooked into).
This should work also with LOAD and SAVE as well. In fact, a better form of directory support should be implementable with yet another special driver:
Code: Select all
LOAD"CATALOG:DEVS",255
LIST
Since the C64 lacks any concept of "current directory," it follows that all paths specified are inherently anchored at the Colonel's root namespace. Therefore, there is no need for a leading colon (contrast with Unix, where to specify an absolute path, you need to specify the leading slash). Support for "current directories" shouldn't be too hard to implement, but at this stage of the game, I don't yet see any need for it.
Just giving an update on my rationale and thinking processes. I'll update here once I finish Colonel to a point where it's usable.
Last edited by kc5tja on Tue Feb 14, 2006 7:25 pm, edited 1 time in total.
Oops -- I forgot to list the 2 critical missing links (although I discussed the first one above just after the example):
(1) Uniform namespace following well-known conventions.
(2) A means of "mounting" new device drivers so that accessing devices was intrinsically location independent (e.g., the device could reside on the 1541, or it could reside on the local computer, with equal ease).
(1) was discussed above.
(2) is achieved by forwarding requests out to the appropriate device. For example, DRV:8:0:FOOBAR would refer to a file called FOOBAR on device 8, first drive. (So, for dual-drive units like the Commodore 8050 disk drive, you could theoretically refer to a file DRV:8:1:BEERBAZ.) Since all Commodore disks have volume labels associated with them, you could reference them like subdirectories too (provided the local forwarding driver supported auto-mounting, which allows things like VOLS:GEOS SYSTEM:KERNAL, which is awfully convenient because now you don't need to know which physical unit number or drive number for the disk you put it in with. Anyone familiar with MacOS or AmigaOS will immediately know just how incredibly adorable this feature is!). For drives that support subdirectories or named, hierarchial partitions that can be used as subdirectories (e.g., the Commodore 1581 disk drive), the forwarder obviously can perform the required translation for names like VOLS:MY DISK:GEOS FILES:GEOWRITE:MOM'S LETTER 02.2005.
The third item that wasn't quite so critical, as evidenced by the success of CP/M versus MP/M, was support for multitasking.
(1) Uniform namespace following well-known conventions.
(2) A means of "mounting" new device drivers so that accessing devices was intrinsically location independent (e.g., the device could reside on the 1541, or it could reside on the local computer, with equal ease).
(1) was discussed above.
(2) is achieved by forwarding requests out to the appropriate device. For example, DRV:8:0:FOOBAR would refer to a file called FOOBAR on device 8, first drive. (So, for dual-drive units like the Commodore 8050 disk drive, you could theoretically refer to a file DRV:8:1:BEERBAZ.) Since all Commodore disks have volume labels associated with them, you could reference them like subdirectories too (provided the local forwarding driver supported auto-mounting, which allows things like VOLS:GEOS SYSTEM:KERNAL, which is awfully convenient because now you don't need to know which physical unit number or drive number for the disk you put it in with. Anyone familiar with MacOS or AmigaOS will immediately know just how incredibly adorable this feature is!). For drives that support subdirectories or named, hierarchial partitions that can be used as subdirectories (e.g., the Commodore 1581 disk drive), the forwarder obviously can perform the required translation for names like VOLS:MY DISK:GEOS FILES:GEOWRITE:MOM'S LETTER 02.2005.
The third item that wasn't quite so critical, as evidenced by the success of CP/M versus MP/M, was support for multitasking.
Hi guys,
only found this thread recently....
As for writing a new 6502 operating system with microkernel architecture, you might want to have a look at my GeckOS http://www.6502.org/users/andre/osa/ operating system. Although I have to admit I plan to overwork the inter-process/thread communications part a bit, as it is not performing well for bulk data (like loading files).
It has a CLI interface only at this time, but filesystems for Commodore disk drives, as well as FAT12/FAT16 filesystems (the latter is experimental) and device drivers for SCSI drives for example.
The microkernel supports only the most basic functionalities, so you can easily use it in embedded devices for example. Wrapped around this is a "lib6502" layer, that defines standard library operations: http://www.6502.org/users/andre/lib6502/index.html
The lib6502 layer could even be ported to other operating systems, the library is designed for applications to run on multitasking, single-tasking whatever systems, as long as the library calls are used.
The lib6502 also has a "semantic" understanding of filenames, which - depending on the system - can be single character drive names/numbers or even multi-char names for a device.
It normally (with the current lib6502 impl.) uses the o65 file format to load files into memory. Concerning the "complexity" - for any system you can define that you do support only a subset of the features. e.g. with the current version there is bit to define "block-wise" alignment, reducing the file size and loader code a bit.
Now I don't want you to use this (of course I'd be happy if you would... ;-), but you may want to have a look at it for some new ideas for your approach.
Andre
only found this thread recently....
As for writing a new 6502 operating system with microkernel architecture, you might want to have a look at my GeckOS http://www.6502.org/users/andre/osa/ operating system. Although I have to admit I plan to overwork the inter-process/thread communications part a bit, as it is not performing well for bulk data (like loading files).
It has a CLI interface only at this time, but filesystems for Commodore disk drives, as well as FAT12/FAT16 filesystems (the latter is experimental) and device drivers for SCSI drives for example.
The microkernel supports only the most basic functionalities, so you can easily use it in embedded devices for example. Wrapped around this is a "lib6502" layer, that defines standard library operations: http://www.6502.org/users/andre/lib6502/index.html
The lib6502 layer could even be ported to other operating systems, the library is designed for applications to run on multitasking, single-tasking whatever systems, as long as the library calls are used.
The lib6502 also has a "semantic" understanding of filenames, which - depending on the system - can be single character drive names/numbers or even multi-char names for a device.
It normally (with the current lib6502 impl.) uses the o65 file format to load files into memory. Concerning the "complexity" - for any system you can define that you do support only a subset of the features. e.g. with the current version there is bit to define "block-wise" alignment, reducing the file size and loader code a bit.
Now I don't want you to use this (of course I'd be happy if you would... ;-), but you may want to have a look at it for some new ideas for your approach.
Andre
Re: Just an idea: a CP/M alike OS for the 6502?
Strangely enough, only 17 years later, this idea got realized: https://github.com/davidgiven/cpm65
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Just an idea: a CP/M alike OS for the 6502?
olav wrote:
Strangely enough, only 17 years later, this idea got realized: https://github.com/davidgiven/cpm65
There are several CP/M lookalikes around that target the 6502. The oldest of them all, as far as I know, is Richard Leary’s DOS/65, which dates back to 1983, I seem to recall.
User floobydust modified Richard’s code to take advantage of the features of the 65C02, resulting in a code shrink and (probably) some performance improvement.
x86? We ain't got no x86. We don't NEED no stinking x86!