6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Oct 06, 2024 3:22 am

All times are UTC




Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Fri Oct 13, 2017 9:48 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8413
Location: Midwestern USA
whartung wrote:
I never really had an idea how it worked on the Commodore. I know (I think) that the disk was Device 8, but beyond that, I'm not sure how things like drivers and such were handled there. I don't even know if the Apple had anything close to what the Atari (or even the Commodore) had. Seems like it was just a bunch of well know addresses that it relied on, rather than a first class abstraction.

Commodore's operating environment depended on the fact that the disk drive was intelligent, offloading the details of raw disk management from the host machine. Each disk had a device number, starting at 8 and in the case of dual drive units, e.g., the 8050 and 8250, a "logical unit" number of 0 or 1, which addressed the target drive mechanism. Functions related to file housekeeping were carried out within the drive in response to simple commands passed from the host machine. For all practical purposes, Commodore's disks were special-purpose computers in themselves, as they had a 6502, along with firmware in ROM and some RAM to act as block buffers and workspace.

This scheme was based upon the IEEE-488 parallel bus (aka GPIB or HPIB) protocol, even in the case of the VIC-20, C-64, etc., and their serial buses. The host's "kernal" ROM contained low-level functions for accessing the peripherals and higher-level functionss for accessing files, which were addressed by file number, as is done in UNIX and Linux. In principal, the Commodore DOS was a vague copy of the way in which the DEC PDP series of minicomputers accessed their peripherals. I'm sure this was because Commodore did their cross-development on PDP-11s and later on, VAX 11/70s.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Fri Oct 13, 2017 11:03 pm 
Offline

Joined: Sun Oct 01, 2017 1:54 pm
Posts: 20
I should clarify one thing that I said a couple times. When I say "self hosting" I mean that the compiler RUNS on and generates code for the same machine. It does NOT necessarily mean that the compiler is BUILT on that machine or that it can build itself on that machine or even that it is written in its own language.
For instance, one might use cc65(I know...) to write the compiler on a PC. Once it's built, the generated program is copied over to, say, a VIC 20 where it can then be used to compile other programs in its language, say BASIC.
The compiler would almost certainly be a bigger program than it could compile reasonably well, for many of the reasons Whartung pointed out. Memory, whether RAM or disk, being the biggest problem.
If I do write a self-hosted compiler, the language will of necessity be rather simple; it will be possible, but not easy, to write a compiler in that language. C is pretty good for writing compilers and C++ is even better, but BASIC is not (my opinions, of course!) I'm crazy, but not crazy enough to try to put a C++ compiler on a VIC 20.


Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 14, 2017 8:06 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10949
Location: England
That's a good definition of self-hosting, for me, and also a desirable goal.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: