Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > CSDb Discussions > device independent IO
2007-06-13 06:32
Oswald

Registered: Apr 2002
Posts: 5086
device independent IO

how good is the kernal in this regard? what has to be done to support mmc / hdd / etc and still being compatible ?
2007-06-13 09:11
yago

Registered: May 2002
Posts: 333
The Commodore-kernal is pretty modern and device-independent, as it offers the same routines for screen,keyboard,rs232,datasette,disk,printer etc..

However, mmc and (non-iec) hdds have been invented after the kernal has been written, and dont use the protocols the kernel knows.

So you need to patch the kernel, or complement it with a cartridge, to get device-independant access to these Devices.

Fortunately, the kernel even provides Vectors for patching, so if the new devices also have clever Software, you wont notice that the original Kernel does not support them.
2007-06-13 09:22
Oswald

Registered: Apr 2002
Posts: 5086
so there's no "driver" concept at all ?
2007-06-13 09:28
Scout

Registered: Dec 2002
Posts: 1570
Quote: so there's no "driver" concept at all ?

There is a driver concept possible, if you look at the Contiki OS for instance.
It's possible, for example, to choose for the RR-NET and the TFE ethernet cards.
One of those drivers are loaded into the OS when chosen in the configuration.
2007-06-13 09:46
Graham
Account closed

Registered: Dec 2002
Posts: 990
@Oswald:

http://codebase64.org/doku.php?id=sourcecode:dos_examples

If you do your IO like this, it is device independent. You can also call the kernal IEC routines directly, but those are not device independent, since they assume that the device is connected to the serial bus.
2007-06-13 09:52
Oswald

Registered: Apr 2002
Posts: 5086
how are the device nrs associated with the real diveces?

ie. #1 is always tape, 8-9-? are always disk, etc ? is it possible to add a 'new' device nr with the handler (driver) for it?


ps,
scout, sigh, thats nowhere close to what Ive asked :)
2007-06-13 10:02
Graham
Account closed

Registered: Dec 2002
Posts: 990
0 is "default IO" which is keyboard for input and screen for output.

1 is a tape drive.

2 is RS232

4 to 7 is normally used by printers (serial)

8 to 30 is any other serial device

It doesn't really matter though. A driver can easily redirect any device number to another device. For example, TFR can redirect device numbers 8 to 11 to ethernet.
2007-06-13 10:13
Oswald

Registered: Apr 2002
Posts: 5086
how does this redirection work?
2007-06-13 10:37
Graham
Account closed

Registered: Dec 2002
Posts: 990
$031A Vector: Kernal OPEN Routine
$031C Vector: Kernal CLOSE Routine
$031E Vector: Kernal CHKIN Routine
$0320 Vector: Kernal CHKOUT Routine
$0322 Vector: Kernal CLRCHN Routine
$0324 Vector: Kernal CHRIN Routine
$0326 Vector: Kernal CHROUT Routine
$032A Vector: Kernal GETIN Routine
$032C Vector: Kernal CLALL Routine
$0330 Vector: Kernal LOAD Routine
$0332 Vector: Kernal SAVE Routine
2007-06-13 10:44
Oswald

Registered: Apr 2002
Posts: 5086
okay, so there's no driver concept at all in the kernal..
2007-06-13 11:13
Scout

Registered: Dec 2002
Posts: 1570
Quote: how are the device nrs associated with the real diveces?

ie. #1 is always tape, 8-9-? are always disk, etc ? is it possible to add a 'new' device nr with the handler (driver) for it?


ps,
scout, sigh, thats nowhere close to what Ive asked :)


Yes, i concluded that too :P

Anyway, free info which you can use elsewhere :D
2007-06-13 11:14
Graham
Account closed

Registered: Dec 2002
Posts: 990
Huh? Ofcourse there is... A cartridge can easily redirect those vectors to own routines which look at the device number and also may continue with the normal kernal routines.
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
codise
instant
Andy/AEG
Jetboy/Elysium
The Human Co../Maste..
Guests online: 69
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 The Demo Coder  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Libertongo  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Morph  (9.5)
9 Dawnfall V1.1  (9.5)
10 It's More Fun to Com..  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Nostalgia  (9.3)
5 Triad  (9.2)
Top Musicians
1 Rob Hubbard  (9.7)
2 Jeroen Tel  (9.7)
3 Mutetus  (9.7)
4 Jammer  (9.6)
5 Linus  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.065 sec.