From 96cd1ac97df0460964ea15b8201a83e3bbc4fbe1 Mon Sep 17 00:00:00 2001 From: Alvin Date: Tue, 6 Oct 2026 23:09:37 +0200 Subject: [PATCH] a --- .gitignore | 3 + C_IMPLEMENTATION.md | 212 + C_OS.md | 151 +- bob.exe | Bin 56592 -> 63875 bytes build.exe | Bin 43703 -> 43703 bytes kernel.basm | 13833 +++++++++++++++++++++++++++++------------ kernel/API.md | 36 +- kernel/bob.h | 5 + kernel/compiler.c | 11 +- kernel/files.c | 18 +- kernel/input.c | 124 + kernel/kernel.c | 4 +- kernel/nano.c | 95 + kernel/shell.c | 46 +- main.c | 72 + storage.c | 80 + tests/AUDIT.md | 61 +- tests/test_console.c | 116 + tests/test_os.c | 289 +- tools/bobcc.c | 599 +- tools/build.c | 4 + 21 files changed, 11805 insertions(+), 3954 deletions(-) create mode 100644 C_IMPLEMENTATION.md create mode 100644 kernel/input.c create mode 100644 kernel/nano.c create mode 100644 storage.c create mode 100644 tests/test_console.c diff --git a/.gitignore b/.gitignore index 3d43339..f0f2a57 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ build/ __pycache__/ + +bob-files.b16 +bob-files.b16.tmp diff --git a/C_IMPLEMENTATION.md b/C_IMPLEMENTATION.md new file mode 100644 index 0000000..28a5609 --- /dev/null +++ b/C_IMPLEMENTATION.md @@ -0,0 +1,212 @@ +# Expanding C support + +The active goal is to implement all C that can reasonably run on bob16. This +is unfinished. Successful subset tests are not proof of a complete C compiler. +Both the host compiler and shell cc/go workflow must be covered before claiming +the goal complete. Existing programs and the nano-like editor must keep working. + +## Work required + +- Define and test a consistent target ABI: character/integer widths, signed and + unsigned conversions/promotions, pointer arithmetic, alignment, aggregate + layouts, calling conventions, floating-point and wider integer representations. +- Expand declarations: complete declarators, typedefs, qualifiers, storage + classes, lexical scopes/shadowing, prototypes, function pointers and variadics. +- Expand types: unsigned/signed integer variants, enums, structs/unions, nested + arrays/pointers and supported floating-point types with software operations. +- Expand expressions: sizeof, conditional/comma operators, full lvalue/type + checking, aggregate access, casts, constant expressions and proper conversions. +- Expand statements: switch/case/default, labels/goto and all loop forms with + correct nesting, scope and break/continue behavior. +- Expand initialization: strings, aggregates, nested/designated initializers, + zero initialization, inferred bounds and relocation of address constants. +- Support translation units/linkage and preprocessing/includes/macros, supplying + target headers rather than reusing incompatible host ABI declarations. +- Supply feasible standard library services, including strings/memory, numeric + conversion, formatted console/file I/O, allocation and mathematical helpers. + Specify unavailable external facilities explicitly rather than accepting them + with incorrect behavior. +- Make the shell workflow use the expanded compiler. Current kernel code nearly + fills its reserved region; compiler/storage architecture and resource limits + need revisiting instead of silently accepting unsupported source. +- Add positive, negative and semantic native-execution tests for each feature, + preserving source/output files after failed compilation and program faults. + +## Verified additions + +The host compiler now implements do/while, including continue to the condition +and break to the loop exit. Local fixed-array initializer lists initialize the +listed elements and zero the remainder; excess elements are rejected. +`host_compiler_and_runtime` executes these features natively and prints bob!. +Conditional ?: selects exactly one branch; comma expressions preserve left-to- +right sequencing while argument and initializer separators remain distinct. +Sizeof handles current scalar/pointer types, declared arrays and string literals +without evaluating its operand; void operands are rejected. It still needs the +full type model (including pointers to arrays, aggregates and qualified types). +Native tests exercise nested conditionals, skipped side effects, comma-based +for-loop steps, argument separators, zero-filled arrays, do-loop control and +unevaluated sizeof increments. Negative tests reject excess initializers, void +sizeof and malformed conditional expressions. These additions are not yet +implemented in the resident compiler; the full goal remains active. + +Block locals now activate at their declaration, can shadow outer locals, +parameters and globals, and expire at block exit. For-declaration scope ends +after its loop. Tests reject duplicate locals/parameters, use before declaration +and out-of-scope names. Frame allocation is fixed per function and includes all +block declarations, so jumps do not require runtime stack adjustment. +Function-scoped labels/goto support forward/backward transfers, including +separate functions with the same label name. Missing/duplicate labels fail +before output files are written. Native tests exercise these transfers. + +Switch/case/default now emit native dispatch, preserve fall-through and evaluate +the controlling expression once. A separate break-context stack distinguishes +loop/switch breaks from continues to enclosing loops. Nested switch labels are +collected independently. Duplicate cases/defaults and labels outside switches +are rejected; continue without an enclosing loop is rejected. +Integer constant expressions now fold arithmetic, bitwise, shift, comparison, +logical and conditional operators using the current 16-bit model. Zero divisors +and invalid shift counts fail compilation. Native tests cover folded bounds, +initializers/cases and nested dispatch. The regression suite passes 289 checks. + +## Resident workflow remains required + +The shell cc/go compiler is still the original small native compiler. The host +compiler additions above do not satisfy that part of the goal. The supplied +kernel occupies 36,009 of its available 36,096 words, program files hold 511 +words, and the machine has 65,536 word addresses. Supporting substantially larger +native programs and a larger compiler requires revisiting code/data placement, +file storage, loading/relocation and compiler resources. Those changes must +preserve native execution, user sources, existing editor behavior and recovery. +Full types, aggregates, linkage, preprocessing/headers and library services +remain required; the goal is not complete. + +## Array/string improvements + +The host compiler preserves explicit string lengths through tokenization, +concatenation, constant pooling and emission. Embedded zero characters no +longer truncate literals or cause distinct literals to share incorrect data. +Sizeof uses the complete literal length rather than strlen. +Array bounds can be inferred from initializer lists or character strings. +Character string initialization supports zero-filled padding and the standard +exact-text-size case without a terminator. Undersized arrays, uninitialized +unsized arrays and string initialization of integer arrays are rejected. +Native tests cover global/local inferred arrays, embedded-zero literals, +concatenation, deduplication, padding, exact-size initialization and sizeof. +299 regression checks pass; the kernel rebuilds at the same 36,009 words. +These features remain host-side until the resident compiler architecture and +full type/declarator model are expanded. + +## Declaration and relocation improvements + +File, block and for declarations now support comma-separated declarators. +Each name starts from the shared base type and applies its own pointer stars, +array bounds and initializer; groups do not introduce an extra block scope. +Tests cover mixed scalar/pointer/array declarations, initialization order, +for-loop scope and same-scope duplicate rejection. +Global scalar pointers can initialize from string literals, addresses of global +objects, array decay/element addresses and constant offsets for current word +element types. Data relocations retain their addend through code compaction. +Native tests verify relocated pointers, embedded-zero string offsets and writes +through global pointers. Reading another global pointer's runtime value is not +accepted as a static address constant. Full declarators, compatible-type checks +and aggregate pointer scaling remain required. + +## Function declaration improvements + +The host parser retains file-scope prototypes instead of discarding them. +Validation rejects conflicting return kinds, parameter kinds/counts, parameter +initializers and object/function name collisions. Empty old-style declarations +remain unspecified and can precede a typed definition. Unused declarations do +not need a definition; called functions still need native code in this unit. +One-dimensional array parameters (sized or unsized) adjust to pointers, consume +one argument word and report pointer size under sizeof. Tests exercise repeated +compatible declarations, forward calls, array traversal, returning a passed +pointer and negative declaration conflicts. Full pointee, qualifier, promotion +and old-style compatibility checks require the richer type model. +Negative compiler tests also verify that rejected source preserves both prior +BASM and binary output files. + +## Derived type foundation + +The host compiler now interns pointer and array descriptors carrying element +type, indirection depth and array bound. Pointer declaration/definition checks +distinguish int*, char*, void* and additional indirection. Array parameters +adjust to pointers to their actual element type rather than a generic pointer. +Array objects retain their element type separately from frame/storage size. + +Sizeof uses expression type inference for addresses, dereferences, subscripts, +calls, assignments, comma expressions and conditionals. Tests verify *&array +retains the array bound, comma/conditional array operands decay to pointers, +and pointer-array dereferences retain their pointee type without evaluation. +Invalid void dereferences and non-pointer subscripts/dereferences in sizeof +are rejected. Signature tests reject differing pointee kinds and depths. +431 regression checks pass and the kernel still rebuilds at 36,009 words. + +This is a foundation rather than a complete type checker. Qualifiers, all +declarator forms, aggregate/wide/floating types, arithmetic conversions, +and constraints on ordinary evaluated expressions still need +implementation. The resident compiler and standard library work also remain. + +## Multidimensional arrays and aggregate initialization + +The host compiler retains all array dimensions, adjusts array parameters to +pointers to rows, and uses recursive storage sizes for frames, data and sizeof. +Pointer arithmetic, increments, compound addition/subtraction and pointer +differences scale by the pointee size. Array assignment/increment, incompatible +pointer subtraction, pointer-plus-pointer and void pointer arithmetic are rejected. + +Initializer parsing recursively flattens nested braces into storage order, +zero-fills omitted subobjects, supports brace elision and infers an omitted outer +bound. Character-array rows accept strings, including braced strings, exact-size +strings without a terminator and padded strings. Global pointer arrays and nested +element addresses retain relocations through code compaction. Scalar braces are +accepted. Struct/union aggregates remain unfinished. + +Native tests exercise three-dimensional arrays, row traversal and differences, +local/global nested initialization, partial rows, inferred bounds, strings, +pointer-array relocations and reversed subscripts in static addresses. Rejection +tests cover excess nested elements, excess string initializers, invalid dimensions +and oversized objects. All 503 regression checks pass; kernel compilation remains +36,009 words. These additions are host compiler features: they do not expand the +resident cc/go parser yet. Full C remains an active, incomplete objective. + +## Array designated initializers + +The host compiler now parses constant array designators, including chained +multidimensional selections. Initialization resumes after the selected subobject; +later entries replace earlier values, omitted elements stay zero and the highest +initialized element determines an omitted outer bound. Recursive initializer +parsing builds a storage-indexed representation before emitting native code. +Pointer designations preserve static relocations and local runtime expressions. + +Native tests cover forward/backward selection, continuation, duplicate selection, +partial row replacement, strings, inferred arrays and local/global pointer arrays. +Rejection tests cover negative/out-of-range indices, excess designator depth, +nonconstant indices, scalar designators and missing equals. The 543 regression +checks pass and the kernel rebuild remains 36,009 words. This is still a host +compiler feature; resident parsing, struct member designators and the rest of the +full-C roadmap remain incomplete. Initializer nesting has a 64-level resource +limit, and objects retain their 4096-word storage limit. + +## Recursive object and abstract declarators + +Object/parameter declarators now collect derived operators outward from the name +and apply them in reverse order to the base type. Parenthesized declarations +therefore distinguish arrays of pointers from pointers to arrays, including +multidimensional rows and arrays of row pointers. Grouped ordinary names and +unnamed row-pointer parameters work through the same parser. Abstract type names +in casts and sizeof also use this model. Sizeof array type names now emits the +full word count instead of assuming every type occupies one word. + +Pointers to incomplete arrays are representable without giving the incomplete +type a fictitious size. Sizeof that pointee and arithmetic requiring its size +reject. Arrays of void, incomplete inner arrays, array casts and conflicting +row-pointer declarations reject. Native tests exercise row-pointer globals, +parameters, local traversal, nested pointers, casts and array/pointer sizeof. +All 583 regression checks pass; the kernel rebuild stays at 36,009 words. + +The parser limits grouping to 32 levels, derived operators to 64 and dimensions +to 16. Function declarator suffixes still use the earlier direct-function parser; +function pointers and functions returning array pointers remain to implement. +Qualifier semantics, compatible incomplete-type merging, the resident compiler +architecture, remaining C types and the standard library are also incomplete. diff --git a/C_OS.md b/C_OS.md index f0fa0e6..f14e975 100644 --- a/C_OS.md +++ b/C_OS.md @@ -33,24 +33,48 @@ the supplied image directly. The welcome message points to `help` and `go bob.c` | `delete name` | Permanently remove a RAM file and free its slot | | `read name` | Print a text file | | `write name bob!` | Create or replace a one-line text file | -| `edit name` | Open an existing text file or create one in the line editor | +| `edit name` | Open/create text in the full-screen editor (Windows console) | | `cc bob.c bob` | Compile a C source file inside the emulator | | `cc bob.c` | Compile to the default program file `app` | | `go bob.c` | Compile to `app` and run only if compilation succeeds | | `go bob.c bob` | Compile and run with an explicit output name | +| `save` | Save all files to a host snapshot | +| `restore yes` | Validate/load that snapshot, replacing the RAM files | | `load name 0x4001 ...` | Store raw bob16 machine words as a program file | | `run name` | Load a binary program into reserved RAM, execute, return | | `halt` | Stop the emulator | Command lines hold up to 127 characters. Longer lines are completely consumed and rejected so their tail cannot become another command. Input is terminated -and handles CRLF, backspace and EOF. Decimal values are signed 16-bit; hex values -cover all 16-bit bit patterns. Addresses are word addresses. +and handles CRLF, backspace and EOF. Decimal input accepts -32768..65535; +positive values above 32767 represent their 16-bit bit pattern. Hex accepts +0x0000..0xFFFF. Addresses are word addresses; allocation sizes must be positive. + +## Shell keys + +In a native Windows console, the shell supplies editing and redraw itself: + +| Key | Action | +| --- | --- | +| Up / Down | Browse the four most recent nonempty commands; Down restores the draft | +| Left / Right | Move within the command | +| Home / End or Ctrl+A / Ctrl+E | Move to the start/end | +| Backspace / Delete | Remove before/at the cursor | +| Ctrl+U | Clear the line | +| Tab | Complete a unique command or filename; list ambiguous matches | +| Ctrl+D / Ctrl+Z | End input | + +Completion operates on the word at the end of the line. Type more characters +when matches are ambiguous. History is session-only, includes failed commands, +and skips consecutive duplicates. `edit` opens its own full-screen view in a +Windows console. Redirected input emits no +redraw or candidate lists. Other terminals use ordinary input; full interactive +key handling currently targets the native Windows console. The RAM filesystem has eight slots, names up to 23 characters and content up to 511 words per file. A character occupies one word. `bob.c` occupies one slot -initially. Files and allocations are lost on exit; disk persistence is not -implemented. Allocation is a zeroing bump allocator with no freeing. `poke` is +initially. Unsaved files and allocations are lost on exit. Use `save` to retain +files between sessions. Allocation is a zeroing bump allocator with no freeing. `poke` is restricted to heap RAM so it cannot corrupt the shell. Copy and rename refuse to overwrite an existing destination. Choose a new @@ -64,8 +88,67 @@ leaves an existing output intact and `go` does not run that old program. Diagnostics report the first detected error's character offset, line and column (one based); the location can be just after the token that caused it. +## Keep files between sessions + +Run from the repository directory, then enter: + +```text +write note bob! +go bob.c +save +halt +``` + +Start the emulator again, enter `kernel.basm` (or use `--os`), and enter +`restore yes`, then `read note` or `run app`. Restore is explicit; startup does +not automatically replace the supplied `bob.c` or other RAM files. + +The default snapshot is `bob-files.b16` in the emulator's working directory. +`save` replaces the previous snapshot, first writing `bob-files.b16.tmp` and +then replacing the destination. Keep a copy of the snapshot for older versions. +Set the host environment variable `BOB16_STORAGE` to choose another file path; +the parent directory must already exist. Messages mention this override. +Restoring replaces **all** RAM files; use `save` first if current files matter. +An invalid, truncated, corrupt or unreadable snapshot leaves RAM unchanged. +The snapshot includes text and program files, not heap allocations or history. + +Native programs contain kernel helper addresses. If the kernel image differs +from the one used to save, restore keeps text and omits binary programs. +Run `go SOURCE` to compile them again. BASM and binary boots of the same kernel +share the same identity. Guest programs cannot invoke the storage service. + ## Edit existing files +In a native Windows console, `edit name` opens a nano-like, non-modal view: +type directly into the file and use the arrow keys to move. The title shows the +filename and `*` when modified; the bottom row lists shortcuts. The view scrolls +vertically and horizontally to keep the cursor visible. + +| Key | Effect | +| --- | --- | +| Ctrl+O | Save to the RAM filesystem and continue editing | +| Ctrl+X | Exit; if modified, ask whether to save | +| Y / N at the exit prompt | Save and exit / discard and exit | +| Ctrl+C at the exit prompt | Cancel and continue editing | +| Ctrl+Z | Toggle undo/redo of the last insertion or deletion | +| Arrows | Move through characters and lines | +| Home / End or Ctrl+A / Ctrl+E | Move to the start/end of the current line | +| Backspace / Delete | Delete before/at the cursor | +| Enter | Insert a newline | +| Tab | Insert a space | + +For example, enter `edit bob.c`, move to the text you want to change, type, +then press Ctrl+O and Ctrl+X. Enter `go bob.c` at the shell to compile/run it. +There are no insert/command modes or colon commands in this view. A failed +save keeps changes in the editor. The file limit remains 511 characters; +additional input is rejected without truncating existing text. Ctrl+D follows +the same safe exit path as Ctrl+X. Saves are to RAM; use shell `save` for disk. + +### Scripted/other-terminal fallback + +For redirected input or terminals without native Windows console support, +the original line interface remains available for scripts: + `edit name` loads the current text, displays numbered lines and opens `edit>`. Typing ordinary text appends a line; existing content is retained. The editor uses a scratch buffer, so opening a file does not immediately change it. @@ -89,7 +172,8 @@ then `:wq` changes the existing source rather than recreating it from scratch. Each edit line has the same 127-character input limit as the shell. Oversize changes and invalid line numbers are rejected while the editor remains open. EOF discards unsaved changes. Binary program files cannot be opened as text. -The editor is a line editor, not a full-screen terminal application. +This fallback is a line editor. Interactive Windows sessions use the full-screen +view described above. ## Compile C inside bob16 @@ -169,10 +253,13 @@ what fits in a single command line; use the resident compiler for larger program | Word addresses | Use | | --- | --- | | `0x0000..0x00FF` | Boot ROM and reserved return sentinel | -| `0x0300..0x8FFF` | Kernel code, globals, strings and editor/compiler buffers | +| `0x0100..0x01FF` | Shell and fallback editor input buffers | +| `0x0300..0x8FFF` | Kernel code, globals and strings | | `0x9000..0xBFFF` | Loaded program, variables and downward program stack | | `0xC000..0xDFFF` | 8,192-word heap | -| `0xE000..0xEFFF` | Kernel stack, growing down from `0xF000` | +| `0xE000..0xE3FF` | Shared editor/compiler scratch (never used concurrently) | +| `0xE400..0xE5FF` | Four-command shell history | +| `0xE600..0xEFFF` | Kernel stack, growing down from `0xF000` | | `0xF000..0xFFFF` | Eight file-content buffers; protected from program writes | There are no interrupts, multitasking or hardware memory protection. The write @@ -207,9 +294,51 @@ the bob16 code generation. The host compiler supports a broader subset: signed ints/chars, word pointers and casts, fixed arrays, constant global initialization, functions and recursion, assignments/compound assignments, arithmetic/bitwise/shift operators, short-circuit logic, comparisons, -increment/decrement, if, while, for, break, continue and returns. -Shadowing, structs, typedefs, unsigned types, floating point, function pointers, -sizeof, variadics, local array initialization and standard headers are unsupported. +increment/decrement, if, while, do/while, for, break, continue, function-scoped +labels/goto and returns. Blocks permit shadowing; for-loop declarations have +loop scope. Duplicate declarations in the same scope are rejected. +Switch/case/default support fall-through, nesting and break; continue targets +the surrounding loop. Integer constant expressions support arithmetic, bitwise, +comparison, logical and conditional operators in bounds/initializers/case labels. +Invalid constant division and shifts are rejected. +Comma-separated declarations work at file/block scope and in for initializers; +each declarator has its own pointer stars and array bounds. Global pointer +initializers can reference strings, global objects and array elements, with +constant offsets scaled to their pointee size. Nested element addresses and +arrays of pointers use relocations as well. +File-scope function prototypes are retained and checked against definitions for +the current scalar/character/pointer kinds and parameter counts. Array parameters +adjust to pointers to their element or row type; the outer bound may be omitted. +Unused prototypes need no definition. Pointer descriptors distinguish current +pointee kinds and indirection depth in prototype checks. Qualifier compatibility, +complete expression checking and linking external definitions remain incomplete. +Multidimensional arrays support indexing, row pointers, scaled pointer arithmetic, +increments and pointer differences. Objects are limited to 4096 words and 16 +dimensions. Global/local initializer lists accept nested braces and brace +elision, with omitted elements zero-filled. Excess initializers are rejected. +Array designators such as `[3] = 7` and `[1][2] = 9` select elements; subsequent +entries continue after the selected subobject. Later initializers replace earlier +values for the same elements. Designators also support pointer arrays and inferred +outer bounds. Indices must be constant and within the array bounds. Initializer +braces are limited to 64 nested levels. +Initialized arrays may omit their outer bound. Character arrays accept string +initializers, with inferred bounds or zero-filled padding. A bound equal to the +text length omits the terminator; character-array rows may initialize from +strings, with or without braces. String literals and concatenation preserve +embedded zero characters, including their contribution to sizeof. +Conditional `?:` and comma expressions preserve branch/sequence behavior. +`sizeof` handles the current word-sized scalar/pointer types, declared arrays +and string literals without evaluating its operand; void operands are rejected. +Structs, typedefs, unsigned types, floating point, function pointers, +Variadics and standard headers are unsupported. `sizeof` tracks array/pointer +expression types, including *&array and array decay in comma/conditional +expressions. Recursive object declarators support grouped names, pointers to +arrays such as `int (*rows)[3]`, and arrays of those pointers. Abstract declarators +in casts and sizeof support these forms too; sizeof array type names uses the +complete storage size. Pointers to incomplete arrays can be declared, but their +pointee has no size for sizeof or arithmetic. Declarators have limits of 32 +parenthesis levels and 64 derived types. Function pointer declarators, functions +returning pointers to arrays, and complete C type checking remain unsupported. Host tools themselves use ordinary host C types. To compile another standalone guest source from the repository root: diff --git a/bob.exe b/bob.exe index 4da52b049ab052d6c4cc76472294536f3bcc70ff..626bb35ffa1e24886ff92be4db86c84c68d7b85d 100644 GIT binary patch literal 63875 zcmeIb4O|@6xj#M&O9Dx7hz5(T(KV8mREdy40ybDSS&~Ibf+10S>$1RZK!M%6FA34u z5*IY&qklK*;40hY4HRswJwV<*kWmHvDnsDS(-idu7&C8 zGqM%Zm1UAte|ws=>YB%Hl)RF3%`{0GmOh^}Gb!m3Cd9=+G@GTiIY={Dp;8kiluzPv z(`5=>&@q6T;O~-enNY79pjsGMDT_QOA`-f(Ksa8vS$c9Nvb)Wag%snJr0oi6hR|!4 zY#j5n{#X9UEY-x*NhrNA;A#y3R(TozkwB$5QIGh;B1tt1>zx57fZcSX5+~725U5m= zdKdaQV)YrgUxSlquEZI4l!D7bFUMnbL|qxrtKyK5Wq7R|&rJNe2ttQ({(p+X93|WaY)FP5aSBE@n3$zL2d*f($t|ku zJR9;CSA=cZMHS)o*_BayF%Tnwg+^k5Uw8CYL;wvuVvWp*&c&@R63u$G^(yNI>-r5> zUsVNO)h>I)JU=AFOJuxEVu8({e4mN-q;KIy~B3- zr;CGcmgS$Uh|FINbZcl?wn=Wk68Fm@=Vq66yezl>7$uIRocO9Fk@RI9C*}6r7?YHX zwwWb+M{i(OS$^++GOGNev4Q9xmq=1YB;_y)MA8TFzak7VG9N)M`T%5)r0+zwIY zYri9TD1h5gIqvTx5v)hd*;FjLa4Ce%KWgoP!Aoema9{M_0kU_dum3m}i~a`r@ZpYL zxuYD#qNSIxTWNIbZQP2UznGMl(!U-Jx~*vSwLz=Bu5y{(G_b9R{Bm%SytgvTz3tRY zs4EJFluZhr8|oojIb+jVw#fDoVtlf!<7lb;ox`O6NXk)=3m5LZl^PeS1oul&mYGGg znb>ZJ@}R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>$vEFl@>*s+`==xSQkk8Wwoc)rf;D(Im@q@ZA_>2!>uTz_u#Xs@EwS6F;V7S6>T-67hZfYABSC zYbm~~@tuB6d70#++5QsZ66s!9G8H5I8b;EmK zAoCBiqsaP(*?D9Ro{#-T;ck8^`-ehV**M;Z5RDh3YbX*jXSk?{kqOXLWq@-tZc-=Q zE3_$RoFc{f?-dG^O=lq1SmEV+^Mx8TPlrV_YiI`#gBvqHM>}uOHR}oOQ?(sMG9!BM z7pB6r*)nrz@Xy(UtWJY5lFVd1bV%Q`9!>ddj!aEZJ~t(7W}yMsRJK&a#YV08KcU^B zgNkN>YO$y19;X%XX-Pd34Qi2>B{B+ar3!1(gjMq{;uJ%twimy&E0DEC%ZTuggwZOh zPNXZBSeNQiT;9JKgGZ`8?RtNZIW&0q0~}m~mlh8)S%u1@B{7usXmVneL|xdS4O**?vwlsit3Dpp zuN!K3G|-}W$g7d4sBEoCrnEviSgWMrPujs+o3gRlr(-TNbj^zcv2_zB`?9s31)`w8 zU<{0NN7F9YT9XLH?)W%Uw3d>8I}joYc!#23y?ZTt8U=p$9@Zg%YgdlhAN6{eFPvYz zle^mRXR_F1!zW(vDaL1`cx-0-8wu~~@#6tOPqA4<4?k?JP@I83gqgdSFf8}Y?%9;U z!`=1RexuwQS;N`A(t)NxMtaMLafl>%YAKl)K_rb z06+S2vEYEOp7je*3yXQGQ}7&bt+Ka~lk9z)S(gA^`*N6HfIs%7;#S0dwLj> b; } int cc_truth(int a) { return !!a; } int cc_loop_depth; -int cc_break_chain[16]; -int cc_continue_chain[16]; +#define cc_break_chain ((int *)0xe3c0) +#define cc_continue_chain ((int *)0xe3d0) int cc_precedence(int op) { if (op == TOKEN_OR) return 1; diff --git a/kernel/files.c b/kernel/files.c index 84cb76c..6301880 100644 --- a/kernel/files.c +++ b/kernel/files.c @@ -3,6 +3,20 @@ int file_lengths[8]; int file_kinds[8]; int file_used[8]; +void file_snapshot(int operation) { + int descriptor[4]; int result; + descriptor[0] = (int)file_names; descriptor[1] = (int)file_lengths; + descriptor[2] = (int)file_kinds; descriptor[3] = (int)file_used; + result = bob_snapshot(descriptor, operation); + if (result == -1) println("Storage unavailable. Check bob-files.b16 location/permissions (or BOB16_STORAGE)."); + else if (result < 0) println("Invalid saved files; RAM files unchanged."); + else if (operation == 0) println("Files saved to bob-files.b16 (or BOB16_STORAGE)."); + else { + println("Files restored; previous RAM files replaced."); + if (result == 1) println("Kernel changed: old programs omitted. Compile restored C sources again."); + } +} + char *file_name(int slot) { return file_names + slot * NAME_WORDS; } /* The upper 4096 words are reserved for file contents, above the kernel stack. Supervised programs cannot write this region. */ @@ -14,9 +28,10 @@ int file_find(char *name) { return -1; } int file_slot(char *name) { - int slot; int length; + int slot; int length; int i; length = strlen(name); if (length == 0 || length >= NAME_WORDS) return -1; + for (i = 0; i < length; i++) if (name[i] < 33 || name[i] > 126) return -1; slot = file_find(name); if (slot >= 0) return slot; for (slot = 0; slot < FILE_COUNT; slot++) { @@ -52,6 +67,7 @@ void file_list(void) { } } if (!count) println("No files."); + print("Used "); print_dec(count); println("/8 slots; limit 511 words per file. delete frees a slot."); } void file_manage(char *operation, char *name, char *destination) { int slot; int target; diff --git a/kernel/input.c b/kernel/input.c new file mode 100644 index 0000000..48826b8 --- /dev/null +++ b/kernel/input.c @@ -0,0 +1,124 @@ +/* Native shell editing; history is stored before command tokenization. */ +#define shell_history ((char *)0xe400) +int history_count; +int input_length; +int input_cursor; +int input_echo; + +void input_redraw(void) { + int i; int width; int start; int end; + if (!input_echo) return; + width = bob_columns() - 6; if (width < 1) width = 1; + start = 0; if (input_cursor >= width) start = input_cursor - width + 1; + end = start + width; if (end > input_length) end = input_length; + print("\r\033[2Kbob> "); + for (i = start; i < end; i++) bob_putc(command_line[i]); + for (i = input_cursor; i < end; i++) print("\033[D"); +} +int input_key(void) { + int key; int next; + key = bob_key(); + if (key != 27) return key; + if (input_echo) return 0; + if (bob_key() != '[') return 0; + next = bob_key(); + if (next == 'A') return 256; + if (next == 'B') return 257; + if (next == 'D') return 258; + if (next == 'C') return 259; + if (next == 'H') return 260; + if (next == 'F') return 261; + if (next == '3' && bob_key() == '~') return 262; + return 0; +} +int input_matches(char *candidate, int start, int count) { + int i; + for (i = 0; i < count; i++) + if (!candidate[i] || candidate[i] != command_line[start + i]) return 0; + return 1; +} +void input_complete(void) { + int start; int count; int matches; int i; int length; char *words; char candidate[24]; char selected[24]; + start = input_cursor; + while (start && command_line[start - 1] != ' ') start--; + count = input_cursor - start; matches = 0; + if (input_cursor != input_length) return; + if (!start) { + words = "help echo clear mem halt list ls dir read write edit load run cc go copy rename delete alloc peek poke save restore"; + while (*words) { + length = 0; + while (*words && *words != ' ') candidate[length++] = *words++; + candidate[length] = 0; if (*words) words++; + if (input_matches(candidate, start, count)) { + matches++; memcpy(selected, candidate, length + 1); + if (input_echo) { if (matches == 1) bob_putc('\n'); print(candidate); print(" "); } + } + } + } else { + for (i = 0; i < FILE_COUNT; i++) { + if (file_used[i] && input_matches(file_name(i), start, count)) { + matches++; memcpy(selected, file_name(i), strlen(file_name(i)) + 1); + if (input_echo) { if (matches == 1) bob_putc('\n'); print(selected); print(" "); } + } + } + } + if (matches == 1) { + length = strlen(selected); + if (start + length < 128) { + memcpy(command_line + start, selected, length + 1); + input_length = start + length; input_cursor = input_length; + } + } + if (input_echo && matches) bob_putc('\n'); + input_redraw(); +} +int shell_read_line(void) { + int key; int i; int truncated; int browsing; char draft[128]; + input_length = 0; input_cursor = 0; truncated = 0; browsing = history_count; + input_echo = bob_terminal(); command_line[0] = 0; draft[0] = 0; + while (1) { + key = input_key(); + if (key == 26) key = -1; + if (key == -1 || key == '\n') break; + if (key == '\r' || key == 0) continue; + if (key == 256 || key == 257) { + if (browsing == history_count) memcpy(draft, command_line, input_length + 1); + if (key == 256 && browsing) browsing--; + if (key == 257 && browsing < history_count) browsing++; + if (browsing == history_count) memcpy(command_line, draft, strlen(draft) + 1); + else memcpy(command_line, shell_history + browsing * 128, strlen(shell_history + browsing * 128) + 1); + input_length = strlen(command_line); input_cursor = input_length; + } else if (key == 258) { if (input_cursor) input_cursor--; } + else if (key == 259) { if (input_cursor < input_length) input_cursor++; } + else if (key == 260 || key == 1) input_cursor = 0; + else if (key == 261 || key == 5) input_cursor = input_length; + else if (key == 21) { input_length = 0; input_cursor = 0; command_line[0] = 0; } + else if (key == 9) { input_complete(); continue; } + else if (key == 262 || key == '\b' || key == 127) { + if (key != 262 && input_cursor) input_cursor--; + else if (key != 262) continue; + if (input_cursor < input_length) { + for (i = input_cursor; i < input_length; i++) command_line[i] = command_line[i + 1]; + input_length--; + } + } else if (key >= 32 && key <= 255) { + if (input_length == 127) truncated = 1; + else { + for (i = input_length; i >= input_cursor; i--) command_line[i + 1] = command_line[i]; + command_line[input_cursor++] = key; input_length++; + } + } + input_redraw(); + } + if (input_echo) bob_putc('\n'); + if (truncated) return -1; + if (key == -1 && !input_length) return -2; + if (input_length && (history_count == 0 || strcmp(command_line, shell_history + (history_count - 1) * 128))) { + if (history_count == 4) { + for (i = 0; i < 384; i++) shell_history[i] = shell_history[i + 128]; + history_count = 3; + } + memcpy(shell_history + history_count * 128, command_line, input_length + 1); history_count++; + } + return input_length; +} diff --git a/kernel/kernel.c b/kernel/kernel.c index 141e76b..47dd68d 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -3,6 +3,8 @@ #include "files.c" #include "compiler.c" #include "shell.c" +#include "input.c" +#include "nano.c" int main(void) { int length; char *sample; @@ -13,7 +15,7 @@ int main(void) { file_write("bob.c", sample, strlen(sample), 0); while (1) { print("bob> "); - length = read_line(command_line, 128); + length = shell_read_line(); if (length == -2) { bob_putc('\n'); return 0; } if (length < 0) println("Command too long."); else shell_command(command_line); diff --git a/kernel/nano.c b/kernel/nano.c new file mode 100644 index 0000000..978f8b4 --- /dev/null +++ b/kernel/nano.c @@ -0,0 +1,95 @@ +/* Full-screen, non-modal editor for an interactive Windows console. */ +int nano_cursor; +int nano_width; +void nano_text(char *text) { + int i; + for (i = 0; text[i] && i < nano_width - 1; i++) bob_putc(text[i]); +} +void nano_position(int row, int column) { + print("\033["); print_dec(row); bob_putc(';'); print_dec(column); bob_putc('H'); +} +int nano_start(int position) { + while (position && edit_buffer[position - 1] != '\n') position--; + return position; +} +int nano_finish(int position) { + while (position < editor_length && edit_buffer[position] != '\n') position++; + return position; +} +void nano_draw(char *name, char *message) { + int rows; int width; int top; int position; int line; int row; int column; int left; int i; + rows = bob_rows(); width = bob_columns(); + nano_width = width; + if (rows < 5) rows = 5; + column = nano_cursor - nano_start(nano_cursor); left = 0; + if (column >= width - 1) left = column - width + 2; + top = nano_start(nano_cursor); + for (i = 0; i < rows - 5 && top; i++) top = nano_start(top - 1); + print("\033[?25l\033[2J\033[H"); print("bob edit: "); print(name); + if (editor_changed(name)) print(" *"); + position = top; row = 2; line = 2; + while (row < rows - 1) { + nano_position(row, 1); i = 0; + while (position < editor_length && edit_buffer[position] != '\n') { + if (i >= left && i - left < width - 1) { + if (edit_buffer[position] >= 32) bob_putc(edit_buffer[position]); + else bob_putc(' '); + } + i++; position++; + } + if (nano_cursor >= top && nano_cursor <= position) line = row; + if (position >= editor_length) break; + position++; top = position; row++; + } + nano_position(rows - 1, 1); nano_text(message); + nano_position(rows, 1); nano_text("^O Save ^X Exit ^Z Undo Arrows Move"); + nano_position(line, column - left + 1); print("\033[?25h"); +} +void nano_edit(char *name) { + int key; int start; int end; int column; int i; int temporary; char text[2]; char *message; + nano_cursor = 0; message = "Ctrl+O saves; Ctrl+X exits."; + while (1) { + nano_draw(name, message); key = input_key(); message = ""; + if (key == -1) key = 24; + if (key == 24) { + if (!editor_changed(name)) break; + nano_draw(name, "Save? Y=yes N=discard ^C=cancel"); + key = input_key(); + if (key == 'n' || key == 'N') break; + if ((key == 'y' || key == 'Y') && editor_save(name)) break; + continue; + } + if (key == 15) { + if (editor_save(name)) message = "Saved to RAM; shell save for disk."; + else message = "Save failed; changes kept."; + } else if (key == 26 && editor_has_undo) { + end = editor_length; if (editor_undo_length > end) end = editor_undo_length; + for (i = 0; i <= end; i++) { + temporary = edit_buffer[i]; edit_buffer[i] = edit_undo[i]; edit_undo[i] = temporary; + } + temporary = editor_length; editor_length = editor_undo_length; editor_undo_length = temporary; + if (nano_cursor > editor_length) nano_cursor = editor_length; + message = "Undo/redo applied."; + } else if (key == 258) { if (nano_cursor) nano_cursor--; } + else if (key == 259) { if (nano_cursor < editor_length) nano_cursor++; } + else if (key == 260 || key == 1) nano_cursor = nano_start(nano_cursor); + else if (key == 261 || key == 5) nano_cursor = nano_finish(nano_cursor); + else if (key == 256 || key == 257) { + start = nano_start(nano_cursor); column = nano_cursor - start; + if (key == 256 && start) start = nano_start(start - 1); + if (key == 257) { end = nano_finish(start); if (end < editor_length) start = end + 1; } + end = nano_finish(start); nano_cursor = start + column; + if (nano_cursor > end) nano_cursor = end; + } else { + start = nano_cursor; end = start; text[0] = 0; text[1] = 0; + if (key == '\b' || key == 127) { if (!start) continue; start--; } + else if (key == 262) { if (end == editor_length) continue; end++; } + else if (key == '\n' || key == 9 || (key >= 32 && key < 256)) { + text[0] = key; if (key == 9) text[0] = ' '; + } else continue; + if (editor_replace(start, end, text, 0)) nano_cursor = start + strlen(text); + else message = "Full: 511 chars. Delete text first."; + } + } + print("\033[2J\033[H"); +} diff --git a/kernel/shell.c b/kernel/shell.c index 2523a96..e1f61e9 100644 --- a/kernel/shell.c +++ b/kernel/shell.c @@ -1,12 +1,12 @@ -char command_line[128]; -char edit_line[128]; -char edit_buffer[512]; -char edit_undo[512]; +#define command_line ((char *)0x100) +#define edit_line ((char *)0x180) +#define edit_buffer ((char *)0xe000) +#define edit_undo ((char *)0xe200) int editor_length; int editor_undo_length; int editor_has_undo; char *arguments; -int program_length; +void nano_edit(char *name); char *next_arg(void) { char *start; @@ -33,6 +33,9 @@ int parse_number(char *text) { if (base == 16) { if (digits == 4) return 0; number = number * 16 + digit; + } else if (!negative) { + if (number < 0 || number > 6553 || (number == 6553 && digit > 5)) return 0; + number = number * 10 + digit; } else { limit = 7; if (negative) limit = 8; if (number < -3276 || (number == -3276 && digit > limit)) return 0; @@ -44,7 +47,7 @@ int parse_number(char *text) { number_ok = 1; if (base == 16) { if (negative) return -number; return number; } if (negative) return number; - return -number; + return number; } int editor_line(int line) { int i; int current; @@ -119,6 +122,7 @@ void edit_file(char *name) { memcpy(edit_buffer, file_content(slot), editor_length); } edit_buffer[editor_length] = 0; + if (bob_terminal()) { nano_edit(name); return; } println("Editor: text appends; :p lists; :i N TEXT inserts; :r N TEXT replaces."); println(":d N deletes; :u undo/redo; :w saves; :q quits; :q! discards; . saves/quits."); println(":p N shows one line. :q protects unsaved edits; :wq also saves/quits."); @@ -198,7 +202,6 @@ void run_file(char *name) { program = (int *)PROGRAM_BASE; memset(program, 0, PROGRAM_WORDS); memcpy(program, file_content(slot), file_lengths[slot]); - program_length = file_lengths[slot]; status = bob_run(PROGRAM_BASE); if (status == -2) println("Program fault; shell restored."); else if (status == -3) println("Program timed out; shell restored."); @@ -208,16 +211,19 @@ void memory_status(void) { print("Heap "); print_hex(HEAP_BASE); print(".."); print_hex(0xdfff); print("; free "); print_dec(HEAP_WORDS - heap_used); println(" words"); print("Programs "); print_hex(PROGRAM_BASE); print(".."); print_hex(0xbfff); println(""); - println("Files: 8 slots, 511 words each; stack above 0xE000."); + println("Files: 8 slots, 511 words each; stack above 0xE600."); } void command_help(char *name) { - if (strcmp(name, "edit") == 0) println("edit NAME: open text; ordinary lines append. :p or :p N views; :i N TEXT inserts; :r N TEXT replaces; :d N deletes; :u undo/redo; :w saves; :q quits safely; :q! discards; . saves/quits."); + if (strcmp(name, "save") == 0 || strcmp(name, "restore") == 0) { + println("save: snapshot all files to bob-files.b16 in the working directory (or BOB16_STORAGE). restore yes: replace RAM files with that snapshot. Save current work first. Changed kernels restore text only; recompile programs."); return; + } + if (strcmp(name, "edit") == 0) println("edit NAME: type/arrows; Ctrl+O saves, Ctrl+X exits, Ctrl+Z undo/redo. Unsaved exit asks Y/N. Redirected input uses the line editor; see C_OS.md."); else if (strcmp(name, "cc") == 0 || strcmp(name, "go") == 0) println("cc SOURCE [OUTPUT]: compile C; output defaults to app. go SOURCE [OUTPUT] also runs on success. Example: go bob.c. One int main(void); no includes. Use edit SOURCE to fix errors."); else if (strcmp(name, "write") == 0) println("write NAME TEXT: create/replace a text file. Example: write note bob! Names: 1..23 characters without spaces; 8 file slots, 511 words each. Use edit for multiple lines."); else if (strcmp(name, "read") == 0) println("read NAME: print text. Example: read bob.c. Use ls to see names; run executes program files."); else if (strcmp(name, "ls") == 0 || strcmp(name, "dir") == 0 || strcmp(name, "list") == 0) - println("ls / dir / list: show names, lengths and text/program kinds. Files are in RAM and lost on exit."); + println("ls / dir / list: show names, lengths and text/program kinds. Files are in RAM; save keeps them between sessions."); else if (strcmp(name, "copy") == 0 || strcmp(name, "rename") == 0 || strcmp(name, "delete") == 0) println("copy OLD NEW | rename OLD NEW | delete NAME. Example: copy bob.c backup.c. Destinations must be new. Copy needs a free slot; rename does not. Delete is permanent."); else if (strcmp(name, "run") == 0) println("run NAME: execute a compiled/loaded program. Example: cc bob.c bob, then run bob. Exit shows return value; faults/timeouts restore the shell."); @@ -228,7 +234,7 @@ void command_help(char *name) { println("alloc WORDS: allocate/zero 1..8192 heap words, print start address; no free. Example: alloc 16. mem shows remaining heap and memory regions."); else if (strcmp(name, "echo") == 0) println("echo TEXT: print text. Example: echo bob!"); else if (strcmp(name, "clear") == 0) println("clear: clear an ANSI-capable terminal; does not remove files."); - else if (strcmp(name, "halt") == 0) println("halt: stop emulator. RAM files and allocations are lost; read important files before quitting."); + else if (strcmp(name, "halt") == 0) println("halt: stop emulator. Unsaved RAM files and allocations are lost; use save before quitting."); else if (strcmp(name, "help") == 0) println("help: list commands. help COMMAND: show usage and an example. Try help edit or help go."); else println("No help for that command. Type help for available names."); } @@ -247,6 +253,14 @@ void shell_command(char *line) { println("cc/go default output: app. Try go bob.c to compile and print bob!"); println("Use hex addresses. poke is limited to heap RAM."); println("Type help COMMAND for usage/examples. Try help edit or help go."); + println("save | restore yes (replaces RAM files); help save for storage details."); + println("Shell keys: Up/Down history; Tab completion; Ctrl+U clears (Windows console)."); + } else if (strcmp(command, "save") == 0) { + if (*next_arg()) println("Usage: save (all RAM files)"); + else file_snapshot(0); + } else if (strcmp(command, "restore") == 0) { + if (strcmp(next_arg(), "yes") || *next_arg()) println("restore yes replaces all RAM files. Use save first to keep current work."); + else file_snapshot(1); } else if (strcmp(command, "echo") == 0) println(remaining_args()); else if (strcmp(command, "clear") == 0) print("\033[2J\033[H"); else if (strcmp(command, "mem") == 0) memory_status(); @@ -265,7 +279,7 @@ void shell_command(char *line) { else println(file_content(value)); } else if (strcmp(command, "write") == 0) { name = next_arg(); text = remaining_args(); - if (file_write(name, text, strlen(text), 0) < 0) println("Cannot write file."); + if (file_write(name, text, strlen(text), 0) < 0) println("Cannot write file. Names: 1..23 printable characters; 8 slots. Use ls or help write."); else println("Saved."); } else if (strcmp(command, "edit") == 0) edit_file(next_arg()); else if (strcmp(command, "load") == 0) { name = next_arg(); load_words(name); } @@ -278,17 +292,17 @@ void shell_command(char *line) { if (value && strcmp(command, "go") == 0) run_file(text); } else if (strcmp(command, "alloc") == 0) { value = parse_number(next_arg()); - if (!number_ok) { println("Invalid allocation size."); return; } + if (!number_ok) { println("Invalid allocation size. Use 1..8192 words; mem shows available space."); return; } pointer = alloc(value); - if (!pointer) println("Allocation failed."); + if (!pointer) println("Allocation failed. Use a positive size within free space; see mem. No free command."); else { print_hex((int)pointer); bob_putc('\n'); } } else if (strcmp(command, "peek") == 0 || strcmp(command, "poke") == 0) { address = parse_number(next_arg()); - if (!number_ok) { println("Invalid address."); return; } + if (!number_ok) { println("Invalid address. Use hex 0x0000..0xFFFF or decimal 0..65535."); return; } pointer = (int *)address; if (strcmp(command, "poke") == 0) { value = parse_number(next_arg()); - if (!number_ok) { println("Invalid value."); return; } + if (!number_ok) { println("Invalid value. Use -32768..65535 or 0x0000..0xFFFF."); return; } if (address >= 0 || address < -16384 || address >= -8192) { println("poke is limited to 0xC000..0xDFFF."); return; } diff --git a/main.c b/main.c index 65812fc..54c7ab4 100644 --- a/main.c +++ b/main.c @@ -118,6 +118,7 @@ /* Kernel disk exposed to the guest boot ROM through trap 4. */ static uint16_t bootDisk[0x10000]; static uint16_t bootWords; +static uint16_t bootOrigin; static bool bootMode; static bool programMode; static bool programDone; @@ -138,6 +139,49 @@ static unsigned readWord(FILE *file) { } static void bootImage(const char *path); +#ifdef _WIN32 +static DWORD originalInputMode; +static bool rawInputStarted; +static void restoreInputMode(void) { + if(rawInputStarted)SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),originalInputMode); +} +#endif +static int terminalAvailable(void) { +#ifdef _WIN32 + DWORD inputMode,outputMode; + return GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),&inputMode) && + GetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE),&outputMode); +#else + return 0; +#endif +} +static int terminalKey(void) { + fflush(stdout); +#ifdef _WIN32 + if(terminalAvailable()) { + HANDLE input=GetStdHandle(STD_INPUT_HANDLE);DWORD mode,count;INPUT_RECORD record; + GetConsoleMode(input,&mode); + if(!rawInputStarted){originalInputMode=mode;rawInputStarted=true;atexit(restoreInputMode);} + SetConsoleMode(input,mode&~ENABLE_PROCESSED_INPUT); + int key=0; + while(ReadConsoleInputA(input,&record,1,&count) && count) { + if(record.EventType!=KEY_EVENT || !record.Event.KeyEvent.bKeyDown)continue; + key=(unsigned char)record.Event.KeyEvent.uChar.AsciiChar; + if(!key) switch(record.Event.KeyEvent.wVirtualKeyCode) { + case VK_UP:key=256;break;case VK_DOWN:key=257;break; + case VK_LEFT:key=258;break;case VK_RIGHT:key=259;break; + case VK_HOME:key=260;break;case VK_END:key=261;break; + case VK_DELETE:key=262;break;default:break; + } + if(key)break; + } + if(key==13)return '\n'; + if(key==4)return -1; + return key; + } +#endif + return getchar(); +} typedef uint16_t ureg_t; typedef int16_t reg_t; @@ -191,6 +235,7 @@ struct ram_t { ureg_t mar; reg_t mdr; } ram; +#include "storage.c" void cpuCycle(void); @@ -450,6 +495,26 @@ void execute() { case 6: cpu.regFile[0] = (int16_t)runProgram((uint16_t)cpu.regFile[0]); break; + case 7: + if(programMode)machineFault(); + cpu.regFile[0]=(int16_t)snapshotService((uint16_t)cpu.regFile[0],cpu.regFile[1]); + break; + case 8: + cpu.regFile[0]=(int16_t)terminalKey(); + break; + case 9: + cpu.regFile[0]=(int16_t)terminalAvailable(); + break; + case 10: + case 11: + cpu.regFile[0]=((cpu.ir>>8)&15)==10?80:25; +#ifdef _WIN32 + { + CONSOLE_SCREEN_BUFFER_INFO info; + if(GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE),&info))cpu.regFile[0]=((cpu.ir>>8)&15)==10?info.dwSize.X:info.srWindow.Bottom-info.srWindow.Top+1; + } +#endif + break; default: machineFault(); } @@ -1053,6 +1118,7 @@ static void bootImage(const char *path) { } fclose(file); bootWords = (uint16_t)words; + bootOrigin = (uint16_t)origin; bootMode = true; memset(&cpu, 0, sizeof(cpu)); memset(&ram, 0, sizeof(ram)); @@ -1085,6 +1151,12 @@ int main(int argc, char** argv) { } } + uint16_t identityWords[0x8d00]; + for(unsigned i=0;i<0x8d00;i++) { + unsigned address=0x300+i; + identityWords[i]=bootMode?(address>=bootOrigin && address= maxCycles) { fprintf(stderr, "CPU cycle limit reached\n"); return 2; } diff --git a/storage.c b/storage.c new file mode 100644 index 0000000..1e2334a --- /dev/null +++ b/storage.c @@ -0,0 +1,80 @@ +/* Included by main.c after ram is defined. Durable file device; guest owns shell. */ +enum { SNAP_WORDS = 4312 }; +static uint32_t kernelIdentity; +static uint32_t snapshotHash(const uint16_t *words, unsigned count) { + uint32_t hash=2166136261u; + for(unsigned i=0;i>8))*16777619u; + } + return hash; +} +static int snapshotValid(const uint16_t *words) { + for(unsigned i=0;i<8;i++) { + unsigned length=words[192+i],kind=words[200+i],used=words[208+i]; + if(used>1 || kind>1 || length>511)return 0; + if(!used)continue; + const uint16_t *name=words+i*24;unsigned n=0; + while(n<24 && name[n]) {if(name[n]<33 || name[n]>126)return 0;n++;} + if(!n || n==24 || words[216+i*512+length])return 0; + if(!kind)for(unsigned k=0;k255)return 0; + for(unsigned j=0;j0xf000)return -3; + unsigned addresses[4],sizes[4]={192,8,8,8}; + for(unsigned i=0;i<4;i++) { + addresses[i]=(uint16_t)ram.memory[descriptor+i]; + if(addresses[i]<0x300 || addresses[i]+sizes[i]>0x9000)return -3; + for(unsigned j=0;j>(8*i));header[12+i]=(unsigned char)(hash>>(8*i));} + int okay=fwrite(header,1,16,file)==16; + for(unsigned i=0;i>8,file)==EOF)okay=0; + if(fclose(file))okay=0; + if(okay) { +#ifdef _WIN32 + okay=MoveFileExA(temporary,path,MOVEFILE_REPLACE_EXISTING|MOVEFILE_WRITE_THROUGH)!=0; +#else + okay=rename(temporary,path)==0; +#endif + } + if(!okay)remove(temporary); + free(temporary);return okay?0:-1; + } + if(operation!=1)return -3; + FILE *file=fopen(path,"rb");if(!file)return -1; + unsigned char header[16];int valid=fread(header,1,16,file)==16; + for(unsigned i=0;i