Compare commits
59
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2aaf1a5c9 | ||
|
|
021aa0d82e | ||
|
|
6fa008ed79 | ||
|
|
e922f086c2 | ||
|
|
605ec9d817 | ||
|
|
1ae867d929 | ||
|
|
40a1c05728 | ||
|
|
2bfbb44cfb | ||
|
|
8ab2d0d04f | ||
|
|
b51881ced7 | ||
|
|
0d6f1e006c | ||
|
|
c70c0b52c3 | ||
|
|
452cc0c8c8 | ||
|
|
3d334b8e8b | ||
|
|
b9643a7b56 | ||
|
|
6902a406b0 | ||
|
|
36ec7bfdb6 | ||
|
|
6c3c0e63d5 | ||
|
|
df71c59aea | ||
|
|
97244a2b95 | ||
|
|
ecca496978 | ||
|
|
e52b4a9763 | ||
|
|
f78eaa3811 | ||
|
|
acb4a15e41 | ||
|
|
d3581eea2e | ||
|
|
1fc00e3e7c | ||
|
|
2f837ace6e | ||
|
|
f8182b24b3 | ||
|
|
f0531ff861 | ||
|
|
3d9c4cb49a | ||
|
|
3a733b1559 | ||
|
|
deb513c925 | ||
|
|
789fb7971a | ||
|
|
4e3acd6af7 | ||
|
|
262d064b6d | ||
|
|
738e5828f6 | ||
|
|
9fa1c859ac | ||
|
|
d01b534a3d | ||
|
|
491b0ea5c3 | ||
|
|
de6fde05cc | ||
|
|
fb675a2299 | ||
|
|
aa374b6816 | ||
|
|
f427b7bcc7 | ||
|
|
4ba3c5b524 | ||
|
|
7180ad39d8 | ||
|
|
6c7bcc1911 | ||
|
|
e09c9b5595 | ||
|
|
9476bb0c8a | ||
|
|
8f7db8507b | ||
|
|
188b1aebb0 | ||
|
|
452203b7b4 | ||
|
|
76c419336e | ||
|
|
2ad0ae8420 | ||
|
|
c0c199bfe6 | ||
|
|
7ec3bcb9b9 | ||
|
|
4bd0a2dfbf | ||
|
|
431e5bc8f4 | ||
|
|
8169d93a9c | ||
|
|
983d9a428d |
+2
-2
@@ -22,8 +22,8 @@ steps:
|
||||
commands:
|
||||
- git fetch --tags
|
||||
- find . -type f -print0 | xargs -0 dos2unix
|
||||
- chmod +x /drone/src/*.sh
|
||||
- /drone/src/compile.sh
|
||||
- chmod +x /drone/src/toolchain/*.sh
|
||||
- /drone/src/toolchain/compile.sh
|
||||
|
||||
- name: upload-iso-artifact
|
||||
image: alpine/git
|
||||
|
||||
+8
-1
@@ -1 +1,8 @@
|
||||
* text=auto eol=lf
|
||||
* text=auto eol=lf
|
||||
lvglh/** linguist-vendored
|
||||
lvgl/** linguist-vendored
|
||||
.vscode/* linguist-vendored
|
||||
lib/* linguist-generated
|
||||
release/* linguist-generated
|
||||
iso/* linguist-generated
|
||||
*.asm linguist-detectable
|
||||
@@ -14,4 +14,8 @@ localenv.json
|
||||
/lvgl/
|
||||
dockerout.txt
|
||||
AGENTS.md
|
||||
lessons_learnt.md
|
||||
*.log
|
||||
/doc/*.md
|
||||
wasuro
|
||||
src/core/core.version.pas
|
||||
|
||||
+1
-2
@@ -14,10 +14,9 @@ RUN curl -sL https://sourceforge.net/projects/freepascal/files/Linux/$FPC_VERSIO
|
||||
pushd fpc-$FPC_VERSION.i386-linux && ./install.sh && popd && \
|
||||
rm -rf fpc-$FPC_VERSION.i386-linux
|
||||
|
||||
COPY compile.sh /compile.sh
|
||||
ADD https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver /usr/bin/semver
|
||||
RUN chmod +x /usr/bin/semver
|
||||
WORKDIR /code
|
||||
RUN find . -type f -print0 | xargs -0 dos2unix
|
||||
ENTRYPOINT ["/bin/bash", "-c"]
|
||||
CMD ["/compile.sh"]
|
||||
CMD ["find toolchain -name '*.sh' -exec dos2unix {} + 2>/dev/null; find toolchain -name '*.sh' -exec chmod +x {} +; bash toolchain/compile.sh"]
|
||||
@@ -0,0 +1,75 @@
|
||||
{ Compatibility shim: wasuro references the old unit name 'lmemorymanager'.
|
||||
Since wasuro/ cannot be modified, this unit re-exports the public API of
|
||||
memory.heap so that 'uses lmemorymanager' continues to compile. }
|
||||
unit lmemorymanager;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
memory.heap;
|
||||
|
||||
const
|
||||
ALLOC_UNIT = memory.heap.ALLOC_UNIT;
|
||||
DATA_OFFSET = memory.heap.DATA_OFFSET;
|
||||
PAGE_SIZE_LMM = memory.heap.PAGE_SIZE_LMM;
|
||||
TOTAL_UNITS = memory.heap.TOTAL_UNITS;
|
||||
BITMAP_DWORDS = memory.heap.BITMAP_DWORDS;
|
||||
SIZE_PREFIX = memory.heap.SIZE_PREFIX;
|
||||
LARGE_ALLOC_MAGIC = memory.heap.LARGE_ALLOC_MAGIC;
|
||||
|
||||
type
|
||||
PHeapPageHeader = memory.heap.PHeapPageHeader;
|
||||
THeapPageHeader = memory.heap.THeapPageHeader;
|
||||
|
||||
procedure init;
|
||||
function kalloc(size : uint32) : void;
|
||||
function klalloc(size : uint32) : void;
|
||||
procedure klfree(address : uint32);
|
||||
function kpalloc(address : uint32) : void;
|
||||
procedure kfree(area : void);
|
||||
function lmm_total_free : uint32;
|
||||
function lmm_page_count : uint32;
|
||||
|
||||
implementation
|
||||
|
||||
procedure init;
|
||||
begin
|
||||
memory.heap.init;
|
||||
end;
|
||||
|
||||
function kalloc(size : uint32) : void; inline;
|
||||
begin
|
||||
kalloc := memory.heap.kalloc(size);
|
||||
end;
|
||||
|
||||
function klalloc(size : uint32) : void; inline;
|
||||
begin
|
||||
klalloc := memory.heap.klalloc(size);
|
||||
end;
|
||||
|
||||
procedure klfree(address : uint32); inline;
|
||||
begin
|
||||
memory.heap.klfree(address);
|
||||
end;
|
||||
|
||||
function kpalloc(address : uint32) : void; inline;
|
||||
begin
|
||||
kpalloc := memory.heap.kpalloc(address);
|
||||
end;
|
||||
|
||||
procedure kfree(area : void); inline;
|
||||
begin
|
||||
memory.heap.kfree(area);
|
||||
end;
|
||||
|
||||
function lmm_total_free : uint32; inline;
|
||||
begin
|
||||
lmm_total_free := memory.heap.lmm_total_free;
|
||||
end;
|
||||
|
||||
function lmm_page_count : uint32; inline;
|
||||
begin
|
||||
lmm_page_count := memory.heap.lmm_page_count;
|
||||
end;
|
||||
|
||||
end.
|
||||
@@ -0,0 +1,7 @@
|
||||
unit types;
|
||||
|
||||
interface
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
echo " "
|
||||
echo "======================="
|
||||
echo " "
|
||||
echo "Compiling FPC Sources..."
|
||||
echo " "
|
||||
fpc -Aelf -gw -g -gl -n -v0ew -O3 -OpPENTIUM3 -Si -Sc -Sg -Xd -CX -XXs -CfSSE -CfSSE2 -Rintel -Pi386 -Tlinux -FElib/ -Fusrc/* -Fusrc/driver/* -Fusrc/driver/net/* -Fusrc/driver/bus/* -Fusrc/driver/bus/usb/* -Fusrc/driver/hid/* src/kernel.pas
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
echo " "
|
||||
echo "======================="
|
||||
echo " "
|
||||
echo "Compiling Stub..."
|
||||
echo " "
|
||||
nasm -f elf src/stub/stub.asm -o lib/stub.o
|
||||
@@ -0,0 +1,32 @@
|
||||
#Flat filesystem
|
||||
|
||||
A super simple filesystem for asuro. Folders are emulated in filenames.
|
||||
|
||||
Starts with disk info sector, sector 0 of volume
|
||||
|
||||
---
|
||||
#### disk info
|
||||
|
||||
jmp2boot : ubit24;
|
||||
OEMName : array[0..7] of char;
|
||||
version : uint16 // numerical version of filesystem
|
||||
sectorCount : uint16;
|
||||
fileCount : uint16
|
||||
signature : uint32 = 0x0B00B1E5
|
||||
|
||||
|
||||
the Rest of the sector is reserved
|
||||
|
||||
---
|
||||
|
||||
Starting from sector 1 is the file table. Table size is determined by entry size (64) * fileCount
|
||||
|
||||
---
|
||||
####File entry
|
||||
|
||||
name : array[0..59] of char //file name max 60 chars
|
||||
fileStart : 16bit // start sector of data
|
||||
fileSize : 16bit // data size in sectors
|
||||
|
||||
---
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
Generated
+1
@@ -0,0 +1 @@
|
||||
Hello from the Asuro ISO!
|
||||
@@ -17,12 +17,12 @@
|
||||
|
||||
@author(Angus C <angus@actm.uk>)
|
||||
}
|
||||
unit base64_prog;
|
||||
unit app.base64;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
stdio, util, strings, tracer, base64, lmemorymanager;
|
||||
io.stdio, core.util, arch.x86.util, core.strings, debug.tracer, core.enc.base64, memory.heap;
|
||||
|
||||
procedure init();
|
||||
|
||||
@@ -38,7 +38,7 @@ var
|
||||
PSize : uInt32;
|
||||
|
||||
begin
|
||||
tracer.push_trace('base64_prog.run');
|
||||
debug.tracer.push_trace('base64_prog.run');
|
||||
if paramCount(Params) > 1 then begin
|
||||
encdec := getParam(0, Params);
|
||||
if stringEquals(encdec, 'encode') then begin
|
||||
@@ -58,23 +58,23 @@ begin
|
||||
dec(pinput);
|
||||
pinput^ := #0;
|
||||
result := b64_encode_str(input);
|
||||
stdio.bufWriteStrLn(stdout_buf, result);
|
||||
io.stdio.bufWriteStrLn(stdout_buf, result);
|
||||
kfree(void(result));
|
||||
end else if stringEquals(encdec, 'decode') then begin
|
||||
input := getParam(1, Params);
|
||||
result := b64_decode_str(input);
|
||||
stdio.bufWriteStrLn(stdout_buf, result);
|
||||
io.stdio.bufWriteStrLn(stdout_buf, result);
|
||||
kfree(void(result));
|
||||
end else stdio.bufWriteStrLn(stderr_buf, 'Usage: base64 <encode/decode> <text>');
|
||||
end else io.stdio.bufWriteStrLn(stderr_buf, 'Usage: core.enc.base64 <encode/decode> <text>');
|
||||
end else begin
|
||||
stdio.bufWriteStrLn(stderr_buf, 'Usage: base64 <encode/decode> <text>');
|
||||
io.stdio.bufWriteStrLn(stderr_buf, 'Usage: core.enc.base64 <encode/decode> <text>');
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure init();
|
||||
begin
|
||||
tracer.push_trace('base64_prog.init');
|
||||
stdio.registerCommand('BASE64', @Run, 'Perform Base64 Encode/Decode.');
|
||||
debug.tracer.push_trace('base64_prog.init');
|
||||
io.stdio.registerCommand('BASE64', @Run, 'Perform Base64 Encode/Decode.');
|
||||
end;
|
||||
|
||||
end.
|
||||
@@ -17,12 +17,12 @@
|
||||
|
||||
@author(Kieron Morris <kjm@kieronmorris.me>)
|
||||
}
|
||||
unit dhclient;
|
||||
unit app.dhclient;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
stdio, util, strings, tracer, dhcp;
|
||||
io.stdio, core.util, arch.x86.util, core.strings, debug.tracer, driver.net.proto.dhcp;
|
||||
|
||||
procedure init();
|
||||
|
||||
@@ -30,14 +30,14 @@ implementation
|
||||
|
||||
procedure run(Params : PParamList; stdin_buf, stdout_buf, stderr_buf : POutBuf);
|
||||
begin
|
||||
tracer.push_trace('dhclient.run');
|
||||
debug.tracer.push_trace('dhclient.run');
|
||||
DHCPDiscover();
|
||||
end;
|
||||
|
||||
procedure init();
|
||||
begin
|
||||
tracer.push_trace('dhclient.init');
|
||||
stdio.registerCommand('DHClient', @Run, 'Run the DHCP configuration utility.');
|
||||
debug.tracer.push_trace('dhclient.init');
|
||||
io.stdio.registerCommand('DHClient', @Run, 'Run the DHCP configuration utility.');
|
||||
end;
|
||||
|
||||
end.
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,145 @@
|
||||
{
|
||||
Prog->app.inio - Inline IO
|
||||
|
||||
Usage:
|
||||
app.inio <file> < Read file contents to terminal
|
||||
app.inio <file> > text Write text to file
|
||||
|
||||
@author(Aaron Hance <[email protected]>)
|
||||
}
|
||||
unit app.inio;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
io.syslog,
|
||||
memory.heap,
|
||||
driver.storage.types,
|
||||
core.strings,
|
||||
io.stdio,
|
||||
debug.tracer,
|
||||
core.util, arch.x86.util,
|
||||
driver.storage.vfs;
|
||||
|
||||
procedure init();
|
||||
|
||||
implementation
|
||||
|
||||
procedure Run(Params : PParamList; stdin_buf, stdout_buf, stderr_buf: POutBuf);
|
||||
var
|
||||
filePath : pchar;
|
||||
absPath : pchar;
|
||||
op : pchar;
|
||||
fError : driver.storage.types.TError;
|
||||
fHandle : driver.storage.vfs.TFileHandle;
|
||||
buf : pchar;
|
||||
bytesRead : uint32;
|
||||
content : pchar;
|
||||
part : pchar;
|
||||
tmp : pchar;
|
||||
i : uint32;
|
||||
pCount : uint32;
|
||||
contentLen : uint32;
|
||||
begin
|
||||
debug.tracer.push_trace('inio.run');
|
||||
|
||||
pCount := paramCount(Params);
|
||||
if pCount < 2 then begin
|
||||
io.syslog.writestringln('Usage: app.inio <file> < | app.inio <file> > text');
|
||||
exit;
|
||||
end;
|
||||
|
||||
filePath := getParam(0, Params);
|
||||
op := getParam(1, Params);
|
||||
|
||||
if filePath = nil then begin
|
||||
io.syslog.writestringln('Error: no file specified.');
|
||||
exit;
|
||||
end;
|
||||
if op = nil then begin
|
||||
io.syslog.writestringln('Error: no operation specified.');
|
||||
exit;
|
||||
end;
|
||||
|
||||
absPath := driver.storage.vfs.MakeAbsolutePath(filePath);
|
||||
|
||||
{ ---- READ ---- }
|
||||
if op[0] = '<' then begin
|
||||
fHandle := driver.storage.vfs.OpenFile(absPath, omReadOnly, wmRewrite, @fError);
|
||||
if (fHandle = 0) or (fError <> eNone) then begin
|
||||
io.syslog.writestringln('Error: cannot open file for reading.');
|
||||
kfree(void(absPath));
|
||||
exit;
|
||||
end;
|
||||
buf := pchar(kalloc(32768));
|
||||
memset(uint32(buf), 0, 32768);
|
||||
bytesRead := driver.storage.vfs.ReadFile(fHandle, 0, puint8(buf), 32767);
|
||||
driver.storage.vfs.CloseFile(fHandle);
|
||||
|
||||
if bytesRead > 0 then begin
|
||||
buf[bytesRead] := char(0);
|
||||
io.syslog.writestring(buf);
|
||||
io.syslog.writestringln(' ');
|
||||
end else begin
|
||||
io.syslog.writestringln('(0 bytes read)');
|
||||
end;
|
||||
kfree(puint32(buf));
|
||||
end
|
||||
|
||||
{ ---- WRITE ---- }
|
||||
else if op[0] = '>' then begin
|
||||
if pCount < 3 then begin
|
||||
io.syslog.writestringln('Error: no content to write.');
|
||||
kfree(void(absPath));
|
||||
exit;
|
||||
end;
|
||||
|
||||
{ Build content string by joining params 2..N with spaces }
|
||||
content := stringCopy(getParam(2, Params));
|
||||
i := 3;
|
||||
while i < pCount do begin
|
||||
part := getParam(i, Params);
|
||||
if part <> nil then begin
|
||||
{ content + ' ' + part }
|
||||
tmp := stringConcat(content, ' ');
|
||||
kfree(void(content));
|
||||
content := stringConcat(tmp, part);
|
||||
kfree(void(tmp));
|
||||
end;
|
||||
i := i + 1;
|
||||
end;
|
||||
|
||||
contentLen := stringSize(content);
|
||||
|
||||
{ Try read-write rewrite first (existing file) }
|
||||
fHandle := driver.storage.vfs.OpenFile(absPath, omReadWrite, wmRewrite, @fError);
|
||||
if (fHandle = 0) or (fError <> eNone) then begin
|
||||
{ Try creating new file }
|
||||
fHandle := driver.storage.vfs.OpenFile(absPath, omWriteOnly, wmNew, @fError);
|
||||
end;
|
||||
|
||||
if (fHandle = 0) or (fError <> eNone) then begin
|
||||
io.syslog.writestringln('Error: cannot open file for writing.');
|
||||
kfree(void(content));
|
||||
kfree(void(absPath));
|
||||
exit;
|
||||
end;
|
||||
|
||||
driver.storage.vfs.WriteFile(fHandle, 0, puint8(content), contentLen);
|
||||
driver.storage.vfs.CloseFile(fHandle);
|
||||
io.syslog.writestringln('Written.');
|
||||
kfree(void(content));
|
||||
end else begin
|
||||
io.syslog.writestringln('Error: operation must be < or >.');
|
||||
end;
|
||||
|
||||
kfree(void(absPath));
|
||||
end;
|
||||
|
||||
procedure init();
|
||||
begin
|
||||
debug.tracer.push_trace('inio.init');
|
||||
io.stdio.registerCommand('INIO', @Run, 'Inline IO: app.inio <file> < | app.inio <file> > text');
|
||||
end;
|
||||
|
||||
end.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user