A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-jar.1376.mcz
==================== Summary ====================
Name: Kernel-jar.1376
Author: jar
Time: 28 February 2021, 7:58:42.007459 pm
UUID: d063e740-7836-a94a-9796-488741d2b2b6
Ancestors: Kernel-codefrau.1374
Fix Process >> #isTerminated inconsistent behavior - for discussion
=============== Diff against Kernel-codefrau.1374 ===============
Item was changed:
----- Method: Process>>isTerminated (in category 'testing') -----
isTerminated
"Answer if the receiver is terminated, or at least terminating."
self isActiveProcess ifTrue: [^ false].
^suspendedContext isNil
+ or: ["If the suspendedContext is the bottomContext and the pc is at the endPC,
+ then there is nothing more to do."
- or: ["If the suspendedContext is the bottomContext it is the block in Process>>newProcess.
- If so, and the pc is at the endPC, the block has already sent and returned
- from value and there is nothing more to do."
suspendedContext isBottomContext
+ and: [suspendedContext pc >= suspendedContext endPC
+ or: [suspendedContext closure
- and: [suspendedContext closure
ifNil: [suspendedContext methodClass == Process
and: [suspendedContext selector == #terminate]]
+ ifNotNil: [false]]]]!
- ifNotNil: [suspendedContext pc >= suspendedContext closure endPC]]]!
Liam wrote:
> I was not merely looking for a lightweight OS. I had a demanding list
of criteria.
> I looked for:
• a clean, simple OS, with SMP support, that supported pre-emption,
memory management etc.
• in a type-safe language, with a native-object-code compiler — not
JITTed, not using a VM or runtime
• and a readable language, not something far outside the Algol family
of imperative HLLs
• that was portable across different architectures
• that was FOSS and could be forked
• that was documented and had a user community who knew it
• that can be built with FOSS tools (which RISC OS fails, for instance)
• which is or was used by non-specialists for general purpose computing
• which can usefully access the Internet
• which runs on commodity hardware
• which does not have a strongly filesystem-centric design that would
not fit a PMEM-only computer (i.e. not an xNix)
I think you have specified a null set.
Alan Kay said: "The best way to predict the future is to invent it."
You have described the world you want to move into.
My only suggestion here is to look at OSs which are easily ported. I
would look at RISC-V because the kind of solution you are looking for
will probably appear there first.
Within "type-strict", you might consider a Rust or Haskell oSs. [I
think Smalltalk is "type-safe", every object knows its class and trying
to access element 41 of a 10 element array gives DNU, but I suspect this
is not your definition].
For small, FreeRTOS and PharOS
(https://sourceforge.net/projects/rtospharos/) look interesting.
From Wikipedia entry on RISC-V:
"Available RISC-V software tools include a GNU Compiler Collection (GCC)
toolchain (with GDB, the debugger), an LLVM toolchain, the OVPsim
simulator (and library of RISC-V Fast Processor Models), the Spike
simulator, and a simulator in QEMU (RV32GC/RV64GC).
Operating system support exists for the Linux kernel, FreeBSD, and
NetBSD, but the supervisor-mode instructions were unstandardized prior
to June 2019,[14] so this support is provisional. The preliminary
FreeBSD port to the RISC-V architecture was upstreamed in February 2016,
and shipped in FreeBSD 11.0.[96][74] Ports of Debian[97] and Fedora[98]
are stabilizing (both only support 64-bit RISC-V, with no plans to
support 32-bit version). A port of Das U-Boot exists.[99] UEFI Spec v2.7
has defined the RISC-V binding and a TianoCore port has been done by HPE
engineers[100] and is expected to be upstreamed. There is a preliminary
port of the seL4 microkernel.[101][102] Hex Five released the first
Secure IoT Stack for RISC-V with FreeRTOS support.[103] Also xv6, a
modern reimplementation of Sixth Edition Unix in ANSI C used for
pedagogical purposes in MIT, was ported. Pharos RTOS has been ported to
64-bit RISC-V[104] (including time and memory protection). Also see
Comparison of real-time operating systems.
"
Note also OSDev.org.
Good on ya,
-KenD
Liam wrote:
> I do not know much about the whole L4 family but what little I know
some of the existing OSes based upon them were very vaguely Unix-ish.
That's precisely what I'm trying to move away from.
• I do not know if SEL4 has working multiprocessor support. I know
that QNX does, which demonstrates that a Unix-like true microkernel
can do this; but I also believe that Minix 3 so far lacks one, and
lacks some APIs needed for POSIX and xNix compatibility. This is not
an easy thing to do.
..
Right. I am thinking of expanding outward from Genode (
https://genode.org/about/index ), start with a small (non-Unix) OS which
runs on (some of) x86/ARM64/RISC-V which can be used as a bootstrap for
Smalltalk->Native runtime, then replace services written in C to
services written in Smalltalk initially with the same API, but later
re-imagined. An ultra-secure OS which has the right basics for
hotplug/live updates. Add eMail & Web browsing after getting core St
GUI up.
This is pretty much a scratch effort. Some C at first, particularly in
the microkernel (e.g. seL4) but this is minimal and kinda like changing
FPGA gates.
We are probably "agreeing loudly" on most of this, particularly given my
ignorance of Oberon.
Later,
-KenD
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-jar.1375.mcz
==================== Summary ====================
Name: Kernel-jar.1375
Author: jar
Time: 28 February 2021, 1:39:18.242036 pm
UUID: 5fa0cf53-5852-2949-b7f0-a13d8729925b
Ancestors: Kernel-codefrau.1374
Fix Process class >> #forContext:priority: potentially crashing image
=============== Diff against Kernel-codefrau.1374 ===============
Item was changed:
----- Method: Process class>>forContext:priority: (in category 'instance creation') -----
forContext: aContext priority: anInteger
"Answer an instance of me that has suspended aContext at priority
anInteger."
| newProcess |
newProcess := self new.
+ newProcess suspendedContext: aContext asContext.
- newProcess suspendedContext: aContext.
newProcess priority: anInteger.
^newProcess!
A new version of Compiler was added to project The Inbox:
http://source.squeak.org/inbox/Compiler-mt.456.mcz
==================== Summary ====================
Name: Compiler-mt.456
Author: mt
Time: 2 February 2021, 11:06:33.099178 am
UUID: 0558759c-0bf7-e946-8a65-c673c49d6c8f
Ancestors: Compiler-mt.455
Forgot to remove old method. Sorry for the noise.
=============== Diff against Compiler-mt.455 ===============
Item was removed:
- ----- Method: Parser>>noContextSwitch (in category 'pragmas - code evaluation') -----
- noContextSwitch
- "By adding this pragma to a method, it will not be preempt the current process on method activation if a higher-priority process is runnable. Any numbered primitive without side effects will do here."
- <pragmaParser>
-
- "Note that primitive 123 once was primitiveValueUninteruptibly but is no longer in use."
- self addPragma: (Pragma keyword: #primitive: arguments: #(123)).
-
- self advance.
- ^ true!
Hi folks,
TL;DR in XTreams-Parsing do I need to add support to account for the "combining mark" as described in this regex tutorial here: https://www.regular-expressions.info/unicode.html
The Unicode code point U+0300 (grave accent) is a "combining mark"
Any code point that is not a combining mark can be followed by any number of combining marks.
This sequence, like U+0061 U+0300 above, is displayed as a single grapheme on the screen.
per: https://www.compart.com/en/unicode/U+00E0 “à” can be encoded several ways:
UTF-8 Encoding:
0xC3 0xA0
UTF-16 Encoding:
0x00E0
UTF-32 Encoding:
0x000000E0
I assume that the sequence 0xC3 0xA0 is the combination the regex dude refers to.
Here are some relevant Printit (values render correctly in Squeak with unifont installed, not so much in the browser where I print them)
Character codePoint:224
Character value: 16r0000E0
Character value: 16r0061
Character value: 16r0300
(Character value: 16r0061) asString , (Character value: 16r0300) asString
Escape: backslash character: character hexes: hexes
<action: 'Escape' arguments: #( 1 2 3 )>
backslash = '\' ifTrue:
[character = $s ifTrue: [^Character space].
character = $t ifTrue: [^Character tab].
character = $n ifTrue: [^Character cr].
character = $r ifTrue: [^Character lf].
character = $x ifTrue: [^('16r', (String withAll: hexes)) asNumber asCharacter]].
^character
Character value: 16r00C3
Character value: 16r00A0
(Character value: 16r00C1) asString , (Character value: 16r00A0) asString
The reason I ask is that just as Character does not (nor should it?) support combining marks
Neither does XTreams-Parsing...from the PEG grammar and the relevant callback I have the following rules:
Escape <- BACKSLASH [x] [0-9A-F]{6} / BACKSLASH [nrts\-\\\[\]\''\"] / EscapeError
EscapeError <- BACKSLASH .
with callback:
Escape: backslash character: character hexes: hexes
<action: 'Escape' arguments: #( 1 2 3 )>
backslash = '\' ifTrue:
[character = $s ifTrue: [^Character space].
character = $t ifTrue: [^Character tab].
character = $n ifTrue: [^Character cr].
character = $r ifTrue: [^Character lf].
character = $x ifTrue: [^('16r', (String withAll: hexes)) asNumber asCharacter]].
^character
which you can see does not support capture of the pair 0x00C3 0x00A0 to return “à”
I am strongly leaning towards ignoring the pairs and assuming that all characters such as above are part of the extension.
Thoughts appreciated.
thx
A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-jar.1375.mcz
==================== Summary ====================
Name: Kernel-jar.1375
Author: jar
Time: 28 February 2021, 1:39:18.242036 pm
UUID: 5fa0cf53-5852-2949-b7f0-a13d8729925b
Ancestors: Kernel-codefrau.1374
Fix Process class >> #forContext:priority: potentially crashing image
=============== Diff against Kernel-codefrau.1374 ===============
Item was changed:
----- Method: Process class>>forContext:priority: (in category 'instance creation') -----
forContext: aContext priority: anInteger
"Answer an instance of me that has suspended aContext at priority
anInteger."
| newProcess |
newProcess := self new.
+ newProcess suspendedContext: aContext asContext.
- newProcess suspendedContext: aContext.
newProcess priority: anInteger.
^newProcess!