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

Basic and Machine Language

Moderator: Moderators

User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: g – an Ultimem OS/GUI under construction

Post by pixel »

Phew! Killed processes release their resources now. Multitasking is quite a slow process but optimizing things would be a great mistake that early. There's now an VICMIDI image (VICE got problems with Ultimem sized ones) instead of an executable. http://hugbox.org/pixel/external/denial/g.zip

How it works
The core (aka kernel) is located in the +3K area. RAM bank 0 contains the master core. Every launched process gets its own copy of the core with per–process data to eliminate the need for bank switches for calls to the core. If you link a shared library instead of the core via the function at $0400 it'll also get its own core so it can link libraries as well. All in all every process or library occupies at least 16K RAM. The benefit of that is that each process or library could use up to 34K RAM. Accordingly calls to a library come with the overhead of banking. Again, lots of room for optimizing memory usage.

Multitasking… the task switcher saves the zero page from $0000–$008f, the stack starting from the stack pointer and the current bank configuration.

Am trying to keep the README at https://github.com/SvenMichaelKlose/g updated.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
groepaz
Vic 20 Scientist
Posts: 1180
Joined: Wed Aug 25, 2010 5:30 pm

Re: g – an Ultimem OS/GUI under construction

Post by groepaz »

VICE got problems with Ultimem sized ones
please report them so it can be fixed :)
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: g – an Ultimem OS/GUI under construction

Post by pixel »

groepaz wrote:
VICE got problems with Ultimem sized ones
please report them so it can be fixed :)
Sorted. :)
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

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

Post by pixel »

"launch" can now wait until the launched process has been killed.

Can now "halt" processes or "resume" them.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

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

Post by pixel »

Added target "vic20g" to the cc65 C compiler, cloned at https://github.com/SvenMichaelKlose/cc65g
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

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

Post by pixel »

34K address space looks like a pretty bad idea. Comes with too much overhead. Will move the core's code to $a000 to get some peace for doing the file system.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

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

Post by pixel »

Codepage 437 – the IBM PC ROM charset reduced:
Image

cc65's stdlib is doing odd things like trying to print char 0 or blocking I/O after a single console char read/print cycle. Otherwise there'd be a shell already.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
groepaz
Vic 20 Scientist
Posts: 1180
Joined: Wed Aug 25, 2010 5:30 pm

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

Post by groepaz »

beware: there are two fundamental problems with using the cc65 libs in a multitasking context:
- it uses kernal I/O, meaning an occasional CLI is executed when you dont want it (eg in CHROUT)
- the cc65 library is not reentrant

i rewrote a couple of those things for my little multitasking experiment (click) back then, you'll probably have to do the same.
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

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

Post by pixel »

groepaz wrote:beware: there are two fundamental problems with using the cc65 libs in a multitasking context:
- it uses kernal I/O, meaning an occasional CLI is executed when you dont want it (eg in CHROUT)
- the cc65 library is not reentrant
The cc65 part doesn't use the KERNAL and every process gets its own zeropage (not including the KERNAL area) and stack. :(
i rewrote a couple of those things for my little multitasking experiment (click) back then, you'll probably have to do the same.
Nice and fast! :)
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

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

Post by Mike »

pixel wrote:Codepage 437 – the IBM PC ROM charset reduced: [...]
I know it's difficult enough to design something remotely readable (read: bearable) in 4x8 pixels, and besides the fact that the glyph '[' is errorneously doubled, but ... that font just looks hideous.

Also, the inclusion of the graphic characters of CP 437 is questionable at least. The font is going to live on a bitmapped display anyway. Any 'graphic' elements that go beyond the letters, numbers and symbols of pure ASCII could be drawn directly. Finally, the choice of or restriction to ASCII surely won't be an impediment for implementing a shell.
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

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

Post by pixel »

Mike wrote:
pixel wrote:Codepage 437 – the IBM PC ROM charset reduced: [...]
I know it's difficult enough to design something remotely readable (read: bearable) in 4x8 pixels, and besides the fact that the glyph '[' is errorneously doubled, but ... that font just looks hideous.
It went through some typographical adjustments. Never mind.
Also, the inclusion of the graphic characters of CP 437 is questionable at least. The font is going to live on a bitmapped display anyway. Any 'graphic' elements that go beyond the letters, numbers and symbols of pure ASCII could be drawn directly. Finally, the choice of or restriction to ASCII surely won't be an impediment for implementing a shell.
It's about compatibility with Unix (terminals). I've done that charset long before I joined Denial. As for the graphics:
Image
They're too damn wide–spread to be ignored. :D
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

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

Post by pixel »

Looking better. Who thought that RTS and RTI store addresses on the stack differently? cc65 is doing fine.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
majikeyric
Vic 20 Afficionado
Posts: 349
Joined: Fri Oct 24, 2014 2:08 pm
Website: http://majikeyric.free.fr
Location: France

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

Post by majikeyric »

pixel wrote: Image
:lol:
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

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

Post by Mike »

pixel wrote:It went through some typographical adjustments. Never mind.
O.K. That being cleared up, here's another one for you in g/src/core/dev/con/charset-4x8.asm:

Code: Select all

[...]
; t
    %0000
    %1000
    %1100
    %1000
    %1000
    %1000
    %1010
    %0100
    %0000
; u
[...]
:?:

(... actually, I went to insert the glyphs of ASCII 32..126 into an unsuspecting MG Text Edit to compare two instances of a Lorem Ipsum text, and found out about this. Judging from your example picture, that should be two rows of %1000 in the middle ...)
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

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

Post by pixel »

Mike wrote: (... actually, I went to insert the glyphs of ASCII 32..126 into an unsuspecting MG Text Edit to compare two instances of a Lorem Ipsum text, and found out about this. Judging from your example picture, that should be two rows of %1000 in the middle ...)
O.K. But please take a look at this new set: Image
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
Post Reply