projects:gforth-as-pid-one:start
                Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| projects:gforth-as-pid-one:start [2014-08-31 16:18] – [FAQ] cas | projects:gforth-as-pid-one:start [2014-10-21 16:17] (aktuell) – [gforth mit diet-libc bauen] cas | ||
|---|---|---|---|
| Zeile 80: | Zeile 80: | ||
| cr .( editor loaded ) cr | cr .( editor loaded ) cr | ||
| </ | </ | ||
| + | |||
| + | ==== Tastaturbelegung ==== | ||
| + | |||
| + | Der Standard-Linux-Kernel startet mit einer Tastaturbelegung für US-amerikanische Tastaturen. Um eine deutsche Tastaturbelegung zu bekommen, sind folgende Optionen: | ||
| + | |||
| + |   * beim Kompilieren des Linux-Kernels die Datei " | ||
| + |   * Unter GForth mittels der Syscalls die Funktion des Linux-Programmes " | ||
| + | * Unter Forth einen neuen Tastaturtreiber schreiben, welcher die Zeichen von US-amerikanisch auf deutsche Tastatur anpasst. | ||
| + | |||
| + | Ein einfacher Tastaturtreiber: | ||
| + | |||
| + | < | ||
| + | \ german keyboard mapping | ||
| + | |||
| + | create keytab $100 allot | ||
| + | keytab $100 erase | ||
| + | |||
| + | : keytrans: char keytab + c! ; | ||
| + | : keyb-de key dup keytab + c@ dup if swap then drop ; | ||
| + | ' keyb-de IS xkey | ||
| + | |||
| + | \ Incomplete german keyboard mapping | ||
| + | char z keytrans: y | ||
| + | char y keytrans: z | ||
| + | char " keytrans: @ | ||
| + | char ö keytrans: ; | ||
| + | char Ö keytrans: : | ||
| + | char ä keytrans: ' | ||
| + | char Ä keytrans: " | ||
| + | char ü keytrans: [ | ||
| + | char Ü keytrans: { | ||
| + | char ; keytrans: < | ||
| + | char : keytrans: > | ||
| + | char # keytrans: \ | ||
| + | char * keytrans: } | ||
| + | char } keytrans: + | ||
| + | char ' keytrans: | | ||
| + | char ? keytrans: _ | ||
| + | char ( keytrans: * | ||
| + | char ) keytrans: ( | ||
| + | char - keytrans: / | ||
| + | char = keytrans: ) | ||
| + | char & keytrans: ^ | ||
| + | char / keytrans: & | ||
| + | char _ keytrans: ? | ||
| + | </ | ||
| + | ===== Linux Syscalls aus GForth für amd64-64bit Linux ===== | ||
| + | |||
| + | < | ||
| + | abi-code sys-getpid | ||
| + | -8 di d) r8 lea \ adjust data stack pointer for new value | ||
| + |       39 # ax mov  \ getpid syscall is " | ||
| + | $0F c, $05 c, \ syscall | ||
| + | ax r8 ) mov \ move result to data-stack (pointer in R8) | ||
| + | r8 ax mov \ return new data-stack pointer in AX | ||
| + | ret \ return from call | ||
| + | end-code | ||
| + | |||
| + | abi-code sys-sync | ||
| + |      162 # ax mov  \ sync syscall is " | ||
| + | $0F c, $05 c, \ syscall | ||
| + | di ax mov \ return data-stack pointer unchanged | ||
| + | ret \ return from call | ||
| + | end-code | ||
| + | |||
| + | abi-code sys-poweroff | ||
| + |        169 # ax mov  \ reboot syscall is " | ||
| + |   | ||
| + | 85072278 # si mov \ magic 2 | ||
| + |   | ||
| + | $0F c, $05 c, \ syscall | ||
| + | ret \ we don't expect to come back | ||
| + | end-code | ||
| + | |||
| + | abi-code sys-reboot | ||
| + |        169 # ax mov  \ reboot syscall is " | ||
| + |   | ||
| + | 85072278 # si mov \ magic 2 | ||
| + |   | ||
| + | $0F c, $05 c, \ syscall | ||
| + | ret \ we don't expect to come back | ||
| + | end-code | ||
| + | |||
| + | \ re-define bye | ||
| + | : bye sys-sync sys-poweroff ; | ||
| + | </ | ||
| + | |||
| ===== Linux Syscalls aus GForth für ia86-32bit Linux ===== | ===== Linux Syscalls aus GForth für ia86-32bit Linux ===== | ||
| Zeile 135: | Zeile 222: | ||
| search --no-floppy --fs-uuid --set=root 3413a572-49e9-47f0-9a27-fb3daa7c13b2 | search --no-floppy --fs-uuid --set=root 3413a572-49e9-47f0-9a27-fb3daa7c13b2 | ||
|         echo    ' |         echo    ' | ||
| - |         linux   /vmlinuz  | + |         linux   /vmforth  | 
| - |         echo    ' | + | |
| - |         initrd  | + | |
| } | } | ||
| + | </ | ||
| + | |||
| + | * Frage: welche Minimalanforderungen an den Rechner hat gforth-na? | ||
| + |   * Antwort: bei Benutzung eines (selbstkompilierten) 2.6.x Linux-Kernels: | ||
| + | |||
| + | ===== gforth mit diet-libc bauen ===== | ||
| + | |||
| + | diet-libc ist eine minimale kleine C-Runtime Library mit der statisch gelinkte, kleine Binaries erzeugt werden koennen. Anbei die Schritte, um das aktuelle gforth aus Bernds git Repository mit der diet-libc zu bauen.  | ||
| + | |||
| + | Der " | ||
| + | |||
| + | < | ||
| + | # cd /usr/src | ||
| + | # wget http:// | ||
| + | --2014-10-21 15: | ||
| + | Resolving www.fefe.de (www.fefe.de)... 2001: | ||
| + | Connecting to www.fefe.de (www.fefe.de)|2001: | ||
| + | HTTP request sent, awaiting response... 200 Coming Up | ||
| + | Length: 626885 (612K) [application/ | ||
| + | Saving to: ‘dietlibc-0.33.tar.bz2’ | ||
| + | |||
| + | 100%[==================================================================================> | ||
| + | |||
| + | 2014-10-21 15:42:57 (531 KB/s) - ‘dietlibc-0.33.tar.bz2’ saved [626885/ | ||
| + | |||
| + | # tar xvfj dietlibc-0.33.tar.bz2 | ||
| + | # make | ||
| + | # install bin-i386/ | ||
| + | # export CC=" | ||
| + | # git clone https:// | ||
| + | # cd gforth | ||
| + | # autoreconf -i | ||
| + | # ./configure | ||
| + | # make | ||
| + | </ | ||
| + | |||
| + | Der " | ||
| + | |||
| + | < | ||
| + | # make install | ||
| + | # strip $(which gforth) | ||
| + | # file $(which gforth-0.7.9_20140402) | ||
| + | / | ||
| + | # ls -l $(which gforth-0.7.9_20140402) | ||
| + | -rwxr-xr-x 1 root root 143496 Oct 21 16:06 / | ||
| </ | </ | ||
projects/gforth-as-pid-one/start.1409494684.txt.gz · Zuletzt geändert: 2014-08-31 16:18 von cas