Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.alexwennerberg.com/dusk-fun
Log | Files | Refs | README

commit 9d6aaa5da0fae81da2f236c9c50f65d04dc7d5e4
parent 453bd2cd6ff99c314cacef9c5ec87713879df61e
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sun, 30 Apr 2023 19:28:16 -0400

Start Guide

Aguide.md | 87+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dunix.fs | 32--------------------------------
2 files changed, 87 insertions(+), 32 deletions(-)

diff --git a/guide.md b/guide.md @@ -0,0 +1,87 @@ +# Introduction to Dusk OS + +[Dusk OS](https://git.sr.ht/~vdupras/duskos) is a 32-bit Forth and C-based operating systemcreated by Virgil Dupras. + +## Manifesto + +Dusk OS is designed to be maximally useful with as simple of an architecture as possible. It builds from bare metal to a simple Forth-based operating system and C compiler. + +Dusk's manifesto calls out the need for an operating system in a future of +civilizational collapse. I take a somewhat different perspective: we are +already living in a "collapse" of computing of a certain kind: software builds +upon greater and greater towers of abstractions and few people are concerned +simplifying things or returning to foundational principles. Foundational +computing infrastructure is either abandoned, hardly maintained, or paid for +and controlled by big tech interests. The average person has no access to a +general-purpose computer and instead has their computing infrastrucure +controlled by centralized cloud services, and almost all computing +infrastructure is in some way compromised (funded and controlled) by big tech +interests. Thus, in my view, Dusk OS is not an OS for the future, it is an OS +for the present. + +Because Big Tech controls so much of computing infrastructure, the structure of +computing largely becomes the kind of technology that Big Tech is concerned +with, ie, technology that is build in the context of a large tech organization +staffed by professional engineers. In this way, computing becomes something +professionalized, rather than something accessible to all. + +Dusk OS is a [Tool for +Conviviality](https://en.wikipedia.org/wiki/Tools_for_Conviviality) -- a means +to gain control and understanding of your computer and the computing needs of +your community. It is relatively early in its development, but it brings me a lot of excitement. + +## Getting started + +Virgil Dupras's +[Substack](https://tumbleforth.substack.com/?utm_source=substack&utm_medium=web&utm_campaign=substack_profile) +explains how to build up to Dusk OS from bare metal, and is, in my view, highly +worth the subscription (which also supports Dusk's development). + +This guide takes the opposite approach -- starting from a user's perspective and then working down. Let's start by cloning the repository. + + +``` +git clone https://git.sr.ht/~vdupras/duskos +cd duskos +``` + +Dusk has a system emulator that runs in a POSIX environment. All you should need is Make and a C compiler. Run: + +``` +make run +``` + +This will open the Dusk OS Forth REPL. This guide won't assume you have Forth knowledge, but it is essential to understanding Dusk more deeply. Pick yourself up a copy of [Starting Forth](https://www.forth.com/starting-forth/) for reading later. + +As a user, here's what you'll need to understand about Forth to get started. First, the primary programming language construct is a word. A word has a definition, and we can call that word directly. For example, we can call the word "words", which prints all the words in the current dictionary namespace: + +``` +words +``` + +Forth has a postfix notation, which means that arguments are placed before the operator. For example, 2 + 3 in forth is instead written 2 3 +. Try it yourself: + +``` +2 3 + . +``` + +The period is also a "word" that emits a number. The plus symbol is also a "word". The number literals are not words, but again, this guide will not teach you forth, just enough forth to interact with the Dusk OS system, coming from a POSIX-like environment. + +So, we have our environment and we're able to execute words. Where do we start? Let's list some files. + +``` +curpath :listdir +``` + +Again, remember our postfix notation. Think of this as analogous to the unix command "ls [path]: -- the path instead comes before the operator. Another example: + +``` +p" doc" Path :listdir +``` + +Let's break this command down. p" is a word that says to interpret a string as a path until the next double quote. TODO + +Next: Change Dirs, List files, cat/head files + +I'm happy to help and answer questions about Dusk. Feel free to email me at +alex@alexwennerberg.com diff --git a/unix.fs b/unix.fs @@ -1,32 +0,0 @@ -\ Getting started with Dusk OS coming from unix -\ -\ When I booted up Dusk OS, my first question was: how do I navigate the fileystem? How do I read/edit files? -\ Here's how to translate from unix to Dusk OS and get started. -\ You can use these words or just read them to understand - -\ Takes no args, operates on current directory -: ls curpath :listdir ; - -\ postfix: p" .." cd -: cd Path :chdir ; - -\ Reading files with ged. It's vi-like -\ We need to import the text editor -\ f<< text/ed.fs -\ f<< text/ged.fs -\ If you want this on boot, you can add those lines to init.fs -\ f" init.fs" vi -: vi edload ged ; -\ save with edsave - -\ q to quit. see doc/text/ged.txt for full docs - -\ Compile a C program using Dusk C from a unix environment - -\ put hello.c in fs -\ run make -\ import the following: -\ f<< comp/c/cc.fs -\ f<< comp/c/lib.fs -\ cc<< hello.c -\ helloworld -> should print "Hello, World!"