From: Svjatoslav Agejenko Date: Sat, 21 Jan 2017 20:21:44 +0000 (+0200) Subject: Updated documentation formatting. X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;ds=inline;h=40c5812d0ead19ae05b4e1f06365d918c370f0ff;hp=9148c6be1c95f309fa01742b1e9e1dc319af502e;p=fifth.git Updated documentation formatting. --- diff --git a/doc/index.html b/doc/index.html index 5478319..837935f 100644 --- a/doc/index.html +++ b/doc/index.html @@ -1,206 +1,840 @@ - - + + - -FIFTH +Fifth - virtual machine, operating system, programming language + + + + + + + +" + + + + + + -

FIFTH - virtual machine, operating system, programming language

- Download -    - Online homepage -    - Other applications hosted on svjatoslav.eu -
-Program author:
-    Svjatoslav Agejenko
-    Homepage: http://svjatoslav.eu
-    Email: svjatoslav@svjatoslav.eu
-
-This software is distributed under GNU GENERAL PUBLIC LICENSE Version 2.
-
-

Introduction

- -Fifth is programming lanquage & operating system, running on -virtual CPU, with custom instruction set. It is much like -Charles Chunk Moore's Forth, it also uses stack architecture, -and many commands are similar. Basically I got familiar with -concepts of Forth, and being inspired created my own system. -

-Note: - -Current implementation does not support object oriented programming. -While working on Fifth I got lots of cool new ideas that require reimplementation -of everything. - +

+

Fifth - virtual machine, operating system, programming language

+
+ + +
+

1 !Project deprecated!

+
+

+Current implementation does not support object oriented +programming. While working on Fifth I got lots of cool new ideas that +require reimplementation of everything. +

+ +

Currently I try to implement those new ideas in the project called - Sixth. - -
-Screenshots - +Sixth +

+ +

+System is built many years ago when I was still using DOS as a primary +operating system. +

+
+
+
+

2 Introduction

+
+

+Fifth is programming lanquage & operating system, running on virtual +CPU, with custom instruction set. It is much like Charles Chunk +Moore's Forth, it also uses stack architecture, and many commands are +similar. Basically I got familiar with concepts of Forth, and being +inspired created my own system. +

+ + + +

+Screenshots +

+ +

Read more about: -
Virtual CPU -
Built-in commands -
Additional commands, realized as loadable modules -
Example Fifth source file - text editor - - -

Installation

- +

+ +
+
+
+

3 Installation

+
+

Just unpack all files, witout altering original directory structure, -somewhere in your hard disk. For example: C:\MISC\FIFTH\.... -To run fifth you need minimally just 2 files. -emulator itself ( EMULATOR.EXE or EMULATOR.COM ), and -virtual disk file ( DISK.RAW ). -Read more about distribution directory layout. - - - -

Software/Hardware/Human requirements

- - -Software: - MS-DOS 6.22, with HIMEM.SYS loaded. - Mouse driver if you have a mouse. - Does work only when CPU is in real mode. - To recompile ASM sources I used FASM (Flat Assembler). - I ran QBasic utilities on QB 4.5 . - VESA support by BIOS, or external driver (UNIVBE). - -Hardware: - Minimum CPU 386. - 64 KB free RAM below 640KB, - 2 MB of free XMS. - VESA compatible video card. - -Human: - Beginner level Forth knowledge is recommended. - Enthusiasm. - - - -

Numbers representation

- - - -Fifth uses hexdecimal number representation as primary. -Numbers shape is formed by dividing a square into four parts. -And manipulating their color (black or white). - - - -

Disk file map, and it's data structures

- - -Core and high-level boot code is stored outside of the filesystem to allow -easy access to it, at early booting time, when filesystem is not yet -initialized. - - disk allocation: - -offset length description - -0 ~4 Kb Fifth core -4 Kb ~32Kb high-level boot code -37 Kb ~65Kb FAT -101Kb ~16MB filesystem data area - - FAT entry format: - --2 last sector --1 empty sector -0 -- .. pointer to next block - - file entry format - -offset length description - -0 4 extension -4 16 name -20 4 entry point -24 4 size -28 4 last modification time - - - -

Core architecture

- - +somewhere in your hard disk. For example: C:\MISC\FIFTH\…. To run +fifth you need minimally just 2 files. emulator itself ( EMULATOR.EXE +or EMULATOR.COM ), and virtual disk file ( DISK.RAW ). +

+ +

+Read more about distribution directory layout +

+
+
+
+

4 Software/Hardware/Human requirements

+
+
+

4.1 Software:

+
+
    +
  • MS-DOS 6.22, with HIMEM.SYS loaded. +
  • +
  • Mouse driver if you have a mouse. +
  • +
  • Does work only when CPU is in real mode. +
  • +
  • To recompile ASM sources I used FASM (Flat Assembler). +
  • +
  • I ran QBasic utilities on QB 4.5 . +
  • +
  • VESA support by BIOS, or external driver (UNIVBE). +
  • +
+
+
+
+

4.2 Hardware:

+
+
    +
  • Minimum CPU 386. +
  • +
  • 64 KB free RAM below 640KB, +
  • +
  • 2 MB of free XMS. +
  • +
  • VESA compatible video card. +
  • +
+
+
+
+

4.3 Human:

+
+
    +
  • Beginner level Forth knowledge is recommended. +
  • +
  • Lots of enthusiasm. +
  • +
+
+
+
+
+

5 Numbers representation

+
+ +
+

numbers.png +

+
+ +

+Because I can define everything, starting from CPU, why not try also +alternative and unique number representation ? +

+ +

+Fifth uses its hexdecimal number representation as primary. Numbers +shape is formed by dividing a square into four parts. And manipulating +their color (black or white). +

+
+
+
+

6 Disk file map, and it's data structures

+
+

+Core and high-level boot code is stored outside of the filesystem to +allow easy access to it, at early booting time, when filesystem is not +yet initialized. +

+
+
+

6.1 disk allocation

+
+ + + +++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
offsetlengthdescription
0~4 KbFifth core
4 Kb~32Kbhigh-level boot code
37 Kb~65KbFAT
101Kb~16MBfilesystem data area
+
+
+
+

6.2 FAT entry format:

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + +
codemeaning
-2last sector
-1empty sector
0 --.. pointer to next block
+
+
+
+

6.3 file entry format

+
+ + + +++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
offsetlengthdescription
04extension
416name
204entry point
244size
284last modification time
+
+
+
+
+

7 Core architecture

+
+

Fifth core is simply some amount of already compiled into machine code and linked together modules (entries in other words). In compilation process modules is compiled one by one and simply stored on top of already existing and growing core. Separately from core is kept -dictionary, this is special list that contain names of compiled modules, -variables etc. and they locations in core. Constants use dictionary space -only. Random word can be removed from dictionary at any time. Currently -dictionary can contain at most 1000 entries. - - - dictionary entry format - -offset length description - -0 4 0 < previous entry - 0 = last - -1 = empty -4 15 module name string -19 1 entry type -20 4 entry data - -Core headers as linked list of module names make up something like dictionary. -When some entry address is needed compiler can quickly run through headers -backwards and find needed entry. - - Possible module types - -type description "execute" action - -0 data compile "num" instruction - with address to module -1 submodule compile "call" instruction - with address to module -2 imm. submodule immediately call to module - - - Memory map: (average) - - -0 ~4096 core -1500000 ~32000 highlevel Fifth boot code -200000h core startup messages area -5200000 end of dynamic memory space - - - -

Fifth source format

- - -Fifth uses a different character table and codes than ASCII. -I call it FSCII (Fifth Standard Code for Information Interchange) -for example space character is not 32 but 255 instead. -I plan to use mainly HEX numbers, and create new characters -to represent numeric values. So typical nemric characters "0123..." -is treated like ordinary letters. - - FSCII: - -DEC HEX function - -0 - 15 0 - F HEX numbers -252 FC backspace -253 FD tabulator (TAB) -254 FE carriage return (CR) -255 FF space - -else ordinary characters, like in ASCII. - - - - - -
+dictionary, this is special list that contain names of compiled +modules, variables etc. and they locations in core. Constants use +dictionary space only. Random word can be removed from dictionary at +any time. Currently dictionary can contain at most 1000 entries. +

+ +
+

7.1 dictionary entry format

+
+ + + +++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
offsetlengthdescription
040 &lt; previous entry
  0 = last
  -1 = empty
415module name string
191entry type
204entry data
+ +

+Core headers as linked list of module names make up something like +dictionary. When some entry address is needed compiler can quickly +run through headers backwards and find needed entry. +

+
+
+
+

7.2 Possible module types

+
+ + + +++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
typedescription"execute" action
0datacompile "num" instruction
  with address to module
1submodulecompile "call" instruction
  with address to module
2imm. submoduleimmediately call to module
+
+
+
+

7.3 Memory map: (average)

+
+ + + +++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<loc><size><desc>
0~4096core
1500000~32000highlevel Fifth boot code
200000h core startup messages area
5200000 end of dynamic memory space
+
+
+ +
+

8 Fifth source format

+
+

+Fifth uses a different character table and codes than ASCII (still +almost similar). I call it FSCII (Fifth Standard Code for Information +Interchange) for example space character is not 32 but 255 instead. I +plan to use mainly HEX numbers, and create new characters to represent +numeric values. So typical nemric characters "0123…" is treated +like ordinary letters. +

+
+
+

8.1 FSCII:

+
+ + + +++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DECHEXfunction
0 - 150 - FHEX numbers
252FCbackspace
253FDtabulator (TAB)
254FEcarriage return (CR)
255FFspace
else ordinary characters, same as in ASCII.
+
+
+
+
+
+ - \ No newline at end of file + diff --git a/doc/index.org b/doc/index.org new file mode 100644 index 0000000..90e87dd --- /dev/null +++ b/doc/index.org @@ -0,0 +1,170 @@ +#+TITLE: Fifth - virtual machine, operating system, programming language + +----- +- [[http://www2.svjatoslav.eu/gitweb/?p=sixth.git;a=snapshot;h=HEAD;sf=tgz][download latest snapshot]] + +- This program is free software; you can redistribute it and/or modify it under + the terms of version 3 of the [[https://www.gnu.org/licenses/lgpl.html][GNU Lesser General Public License]] or later as + published by the Free Software Foundation. + +- Program author: + - Svjatoslav Agejenko + - Homepage: http://svjatoslav.eu + - Email: mailto://svjatoslav@svjatoslav.eu + +- [[http://svjatoslav.eu/programs.jsp][other applications hosted at svjatoslav.eu]] + +* (document settings) :noexport: +** use dark style for TWBS-HTML exporter +#+HTML_HEAD: +#+HTML_HEAD: +#+HTML_HEAD: " +#+HTML_HEAD: +* !Project deprecated! +Current implementation does not support object oriented +programming. While working on Fifth I got lots of cool new ideas that +require reimplementation of everything. + +Currently I try to implement those new ideas in the project called +[[http://www2.svjatoslav.eu/gitbrowse/sixth/doc/index.html][Sixth]] + +System is built many years ago when I was still using DOS as a primary +operating system. +* Introduction +Fifth is programming lanquage & operating system, running on [[emulator.html][virtual +CPU]], with custom instruction set. It is much like Charles Chunk +Moore's Forth, it also uses stack architecture, and many commands are +similar. Basically I got familiar with concepts of Forth, and being +inspired created my own system. + + + +[[shots/index.html][Screenshots]] + +Read more about: +- [[file:emulator.html][Virtual CPU]] +- [[file:commands/index.html][Built-in commands]] +- [[file:modules/index.html][Additional commands, realized as loadable modules]] +- [[file:5TH_ET.txt][Example Fifth source file - text editor]] +* Installation +Just unpack all files, witout altering original directory structure, +somewhere in your hard disk. For example: C:\MISC\FIFTH\.... To run +fifth you need minimally just 2 files. emulator itself ( EMULATOR.EXE +or EMULATOR.COM ), and virtual disk file ( DISK.RAW ). + +Read more about [[files.txt][distribution directory layout]] +* Software/Hardware/Human requirements +** Software: +- MS-DOS 6.22, with HIMEM.SYS loaded. +- Mouse driver if you have a mouse. +- Does work only when CPU is in real mode. +- To recompile ASM sources I used FASM (Flat Assembler). +- I ran QBasic utilities on QB 4.5 . +- VESA support by BIOS, or external driver (UNIVBE). +** Hardware: +- Minimum CPU 386. +- 64 KB free RAM below 640KB, +- 2 MB of free XMS. +- VESA compatible video card. +** Human: +- Beginner level Forth knowledge is recommended. +- Lots of enthusiasm. +* Numbers representation + +[[file:numbers.png][file:numbers.png]] + +Because I can define everything, starting from CPU, why not try also +alternative and unique number representation ? + +Fifth uses its hexdecimal number representation as primary. Numbers +shape is formed by dividing a square into four parts. And manipulating +their color (black or white). +* Disk file map, and it's data structures + + +Core and high-level boot code is stored outside of the filesystem to +allow easy access to it, at early booting time, when filesystem is not +yet initialized. +** disk allocation +| offset | length | description | +|--------+--------+----------------------| +| 0 | ~4 Kb | Fifth core | +| 4 Kb | ~32Kb | high-level boot code | +| 37 Kb | ~65Kb | FAT | +| 101Kb | ~16MB | filesystem data area | +** FAT entry format: +| code | meaning | +|------+--------------------------| +| -2 | last sector | +| -1 | empty sector | +| 0 -- | .. pointer to next block | +** file entry format +| offset | length | description | +|--------+--------+------------------------| +| 0 | 4 | extension | +| 4 | 16 | name | +| 20 | 4 | entry point | +| 24 | 4 | size | +| 28 | 4 | last modification time | +* Core architecture +Fifth core is simply some amount of already compiled into machine code +and linked together modules (entries in other words). In compilation +process modules is compiled one by one and simply stored on top of +already existing and growing core. Separately from core is kept +dictionary, this is special list that contain names of compiled +modules, variables etc. and they locations in core. Constants use +dictionary space only. Random word can be removed from dictionary at +any time. Currently dictionary can contain at most 1000 entries. +** dictionary entry format +| offset | length | description | +|--------+--------+-----------------------| +| 0 | 4 | 0 < previous entry | +| | | 0 = last | +| | | -1 = empty | +|--------+--------+-----------------------| +| 4 | 15 | module name string | +|--------+--------+-----------------------| +| 19 | 1 | entry type | +|--------+--------+-----------------------| +| 20 | 4 | entry data | + +Core headers as linked list of module names make up something like +dictionary. When some entry address is needed compiler can quickly +run through headers backwards and find needed entry. +** Possible module types +| type | description | "execute" action | +|------+----------------+----------------------------| +| 0 | data | compile "num" instruction | +| | | with address to module | +|------+----------------+----------------------------| +| 1 | submodule | compile "call" instruction | +| | | with address to module | +|------+----------------+----------------------------| +| 2 | imm. submodule | immediately call to module | +** Memory map: (average) +| | | | +|---------+--------+-----------------------------| +| 0 | ~4096 | core | +| 1500000 | ~32000 | highlevel Fifth boot code | +| 200000h | | core startup messages area | +| 5200000 | | end of dynamic memory space | +* Fifth source format +Fifth uses a different character table and codes than ASCII (still +almost similar). I call it FSCII (Fifth Standard Code for Information +Interchange) for example space character is not 32 but 255 instead. I +plan to use mainly HEX numbers, and create new characters to represent +numeric values. So typical nemric characters "0123..." is treated +like ordinary letters. +** FSCII: + +| DEC | HEX | function | +|--------+-------+----------------------------------------| +| 0 - 15 | 0 - F | HEX numbers | +| 252 | FC | backspace | +| 253 | FD | tabulator (TAB) | +| 254 | FE | carriage return (CR) | +| 255 | FF | space | +| else | | ordinary characters, same as in ASCII. |