Page 1 of 6

g – a multitasking OS for Ultimem/VICMIDI (WIP)

Posted: Sun Mar 13, 2016 9:46 am
by pixel
Mainly a quick hack of graphics primitives yet:
Image

Unlike vin this GUI uses a bitmapped screen and is intended to waste Ultimem's RAM and ROM as if there's no tomorrow, so applications don't have to be relocatable.

This one also introduces a bytecode interpreter. Machine and bytecode can be mixed easily. Possibly an inspiration for those who want to hammer large applications from the PET or C64 into the VIC. If cc65 had support for this kind of thing to squeeze down repetitive code – phoarrh.

However, a source says more than a thousand words: https://github.com/SvenMichaelKlose/g
cc65 C compiler with "vic20g" target: https://github.com/SvenMichaelKlose/cc65g

Why g?

* Program loader on steroids, crack cocaine and Jolt at once.
* You'll be glad when the apocalypse is on. Or if your real PC blew up and you can at least edit text on SD card for profit.
* A new bunch of retro software that has been written in ANSI–C becomes available for easy porting.
* Tool for learning programming and doing homework for minors that is simple Mum will be impressed – and it doesn't come with all the porn. Wouldn't bet on the latter for too long, though.
* NSA–free desktop.
:D

Re: g – another GUI under construction

Posted: Sun Mar 13, 2016 10:41 am
by Mike
Any good reason g only sports a bitmap of 160x176 instead of 160x192?

Re: g – another GUI under construction

Posted: Sun Mar 13, 2016 11:05 am
by pixel
Mike wrote:Any good reason g only sports a bitmap of 160x176 instead of 160x192?
Just because I couldn't get it to run with a higher resolution on the first attempt and preferred to focus on the stuff that would probably fry my brain trying, like clipping text.
But if you say that 160x192 should work… well… I'll just take a shower and do it. :)

Re: g – another GUI under construction

Posted: Sun Mar 13, 2016 11:22 am
by Mike
pixel wrote:But if you say that 160x192 should work…
It's not as if MINIGRAFIK hadn't been around for quite some time now. :?

Re: g – another GUI under construction

Posted: Sun Mar 13, 2016 11:42 am
by pixel
Mike wrote:
pixel wrote:But if you say that 160x192 should work…
It's not as if MINIGRAFIK hadn't been around for quite some time now. :?
I have another great excuse: when I wrote those routines there was only 56.6kbaud Internet around, which is a real pain up main street if you want to look up things. :D But I assume it's about moving charset and screen to $1000 and offset the character values. Back in a sec.

Re: g – another GUI under construction

Posted: Sun Mar 13, 2016 11:50 am
by Mike
When the 160x192 mode was hinted at in "64'er Sonderheft 3", page 60, there even wasn't any Internet around accessible for the general public: :twisted:
64'er SH 3/86 wrote:Immer wenn über die VC-20-Grafik geschrieben wurde, bekam man bisher vorgerechnet, daß die Auflösung nicht 28160 Punkte überschreiten kann. Um es gleich vorwegzunehmen: In der Tat ist die echte Maximalauflösung mit 160 * 192 = 30720, wie sie durch entsprechendes Umgestalten der Data-Becker-Grafik aus dem Buch »Tips & Tricks für den VC 20« gelang, [...]
So, no reason to settle for anything less than 160x192 nowadays. ;)

Re: g – another GUI under construction

Posted: Sun Mar 13, 2016 12:26 pm
by pixel
Shower worked wonders – 160x192 it is! Thanks, Mike! :D

Re: g – another GUI under construction

Posted: Sun Mar 13, 2016 1:53 pm
by pixel
And that's where the trouble starts. Who'd want to contribute to a VIC GUI at all even if one could use tools of his choice?

Re: g – another GUI under construction

Posted: Sun Mar 13, 2016 2:38 pm
by Mike
@pixel: PM sent

Re: g – another GUI under construction

Posted: Mon Mar 14, 2016 2:14 am
by pixel
Here's an idea to get around backwards compatibility issues and have everybody use the tools of his choice.

All applications start at $2000. The +3K area is reserved for g.

Jump tables must be requested by an application using a list of ASCIIZ strings that denote the calls wanted, so new functions can be added or removed without breaking everything. Like so:

Code: Select all

	org $2000
	
	jsr $400					; The one and only fixed jump to g – requesting a jump table.
	.byte <myjumps, >myjumps	; Where the jump table is wanted.
	.ascii "/lib/g" 0				; Module on the file system. Fancy some taste of UN*X?
	.ascii "box", 0
	.ascii "frame", 0
	.ascii "putstring", 0
	.ascii "exit", 0
	.byte 0					; End of list – g returns to the following instruction.

	; Rest of awesome application.
	…
	jmp exit
	
myjumps:
box:		jmp $0		; Could also be just three free bytes.
frame:	jmp $0
putstring:	jmp $0
exit:		jmp $0
Libraries that provide syscalls start with a header:

Code: Select all

	.ascii "box", 0, <box, >box
	.ascii "frame", 0, <frame, >frame
	.ascii "putstring", 0, <putstring, >putstring
	.ascii "exit", 0, <exit, >exit
	.byte 0
	
	org $2000

	jmp init_lib
	jmp uninit_lib

box:		…
frame:	…
putstring:	…
exit:		…
All versioning problems virtually solved. Your not happy with the window manager? Invented a new input device? Mike soldered an Amiga AGA chip into your VIC? Just put the right lib into place. 8)

The path could also point to another running process, so we get inter–process communication.

Re: g – an Ultimem OS/GUI under construction

Posted: Mon Mar 14, 2016 4:26 am
by orion70
Wasn't there another WIP years ago? What happened to Kananga's try? It already included a disk utility :).
Current work folder here.

Re: g – an Ultimem OS/GUI under construction

Posted: Mon Mar 14, 2016 4:54 am
by pixel
orion70 wrote:Wasn't there another WIP years ago? What happened to Kananga's try? It already included a disk utility :).
Current work folder here.
Yes, it's very exciting work and the reason why I kept my hands off an own attempt earlier. Am hoping that Kananga would like to port it to some UltiOS. At the moment I'm thinking about the non–graphical part (memory, I/O and process management – all the mega–boring stuff) that would make it easy for him as well.

Imagine multitasking and hibernating the system to ROM...

Re: g – an Ultimem OS/GUI under construction

Posted: Mon Mar 14, 2016 5:05 am
by majikeyric
Great project pixel! :mrgreen:

With your talent it can be only a success! 8)

Can't wait for the Ultimem :lol:

Re: g – an Ultimem OS/GUI under construction

Posted: Tue Mar 15, 2016 7:41 am
by pixel
:oops:

Well, bank allocation was the first and last no–brainer. Writing OSes is a brutal sport.

Am about to use the +3K area mostly for jump table destinations – generated functions which will set the right banks before hopping to the real deals.

Banking is causing confusion right away because you probably want to share banks instead of copying data. The most simple fix I can see for that is to switch only banks the callee allocated so all other banks are shared across calls without further intervention. Back to programs having to start with a load address. I assume that BLK5 will probably be not shared most of the time as it seems to be convenient to place libraries there.

Moreover I'm certain that you will want KERNAL–compatible I/O so you could port programs more swiftly. Oh, speaking of I/O: the regular KERNAL has to stay in unless somebody is crazy enough to write a replacement, I guess.

Re: g – an Ultimem OS/GUI under construction

Posted: Tue Mar 15, 2016 8:03 am
by Mike
pixel wrote:the regular KERNAL has to stay in unless somebody is crazy enough to write a replacement, I guess.
At least g should be aware of JiffyDOS in place of a standard KERNAL. 8)