Skip to content

Commit d7451f3

Browse files
committed
Update
1 parent 8676642 commit d7451f3

19 files changed

Lines changed: 186 additions & 174 deletions

TODO

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Progress:
2+
Fix Save.
23
HIMEM
34
LOAD and SAVE memory.
45
- Break check
@@ -20,6 +21,17 @@ Progress:
2021

2122
Ongoing:
2223
Code reading.
23-
Continue documentation.
24-
24+
Continue documentation.
25+
26+
Sorry for the misunderstanding. It is functioning as designed ... just like POSIX 'write', and for mostly the same reasons (tho if I could do IEC in an interrupt, I could take up to 256 bytes at a time instead of 64). Going into detail below so everyone can learn something:
27+
28+
Kernels don't want to buffer data ... they only want to take what they can immediately hand over to a device driver. This is for several reasons, but the most important one is that kernel memory is typically allocated statically or per-process, and kernels need to treat all processes fairly (not letting one bad actor starve the others). As a consequence, when a user performs a write, kernels have three choices:
29+
1. They can copy the immediately deliverable portion of the data into a small, per-socket buffer,
30+
2. They can block the process until they can deliver the data,
31+
3. They can ask the process not to move or alter the data until signaled.
32+
33+
#3 is hard on everyone, and #2 is a non-starter on an interactive system (even tho y'all are currently blocking yourselves, my games and operating systems won't be doing so). That leaves #1. Most unix-like kernels make the same choice for the same reason. Do a "man 2 read" and a "man 2 write" and you'll see the exact same interface.
34+
35+
Now if you look under the covers of stdio, you're going to find that it just sits in a loop until it completes the read or write (or hits an error). Why doesn't the kernel do it instead? As designed, if you use the POSIX style interface, and you find that a socket is busy, you can do something else until it's no longer busy. This lets you effect multi-tasking within a single process. If you want to give up that ability for convenience (stdio), you're free to do so, but if the kernel blocked until the full write was complete, then everyone would be forced to give up the ability to multi-task.
2536

37+
There's an extra little wrinkle with IEC. Without IEC interrupts, I basically have to do the transfer on the user's thread. This wouldn't be so bad, except IEC really is quite slow, and if I supported transactions of more than ~64 bytes at a time, the transfer could take so long that the kernel could run out of event objects and you would lose keystrokes or mouse events. Thus, I force the driver to take no more than 64 bytes at a time. This isn't a general limit (the kernel can take either 256 or 512 bytes depending on the device), and so it isn't an error to send more than 64 ... the kernel just won't take any more than that at a time for your own protection

bin/basic.rom

0 Bytes
Binary file not shown.

source/Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,19 +158,19 @@ prelim:
158158

159159
release:
160160
make -C . testbasic
161-
$(CCOPY) $(APPNAME) release$(S)basic_autoload.rom
161+
$(CCOPY) $(APPNAME) release$(S)$(S)roms$(S)basic_autoload.rom
162162
make -C . basic
163-
$(CCOPY) $(APPNAME) release$(S)basic.rom
163+
$(CCOPY) $(APPNAME) release$(S)roms$(S)basic.rom
164164
make -C build build
165165
$(CCOPY) build$(S)*.bin release
166166
$(CCOPY) build$(S)bulk.csv release
167-
$(CCOPY) ..$(S)CHANGES release
168-
$(CCOPY) ..$(S)reference$(S)source$(S)*.pdf release
169-
$(CCOPY) ..$(S)documents$(S)C256_Foenix_JR_UM_Rev002.pdf release
170-
$(CCOPY) ..$(S)documents$(S)superbasic.sublime-syntax release
167+
$(CCOPY) ..$(S)CHANGES release$(S)documents
168+
$(CCOPY) ..$(S)reference$(S)source$(S)*.pdf release$(S)documents
169+
$(CCOPY) ..$(S)documents$(S)C256_Foenix_JR_UM_Rev002.pdf release$(S)documents
170+
$(CCOPY) ..$(S)documents$(S)superbasic.sublime-syntax release$(S)documents
171171

172172
$(CDEL) release$(S)superbasic.zip
173-
zip release$(S)superbasic.zip release$(S)*
173+
zip -r release$(S)superbasic.zip release$(S)*
174174
#
175175
# Run various tests.
176176
#

source/build/02.bin

0 Bytes
Binary file not shown.

source/build/03.bin

0 Bytes
Binary file not shown.

source/build/basic.rom

0 Bytes
Binary file not shown.

source/common/generated/timestamp.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
; This file is automatically generated.
33
;
44
.section code
5-
.text "Alpha 21 built 01-Jan-23. "
5+
.text "Alpha 22 built 01-Jan-23. "
66
.send code

0 commit comments

Comments
 (0)