1
5
mirror of https://github.com/vinc/moros.git synced 2024-06-18 15:07:08 +00:00
Commit Graph

264 Commits

Author SHA1 Message Date
Vincent Ollivier
be6ca0c744
Replace some rust programs with lisp scripts (#445)
* Replace colors command with colors.lsp

* Replace geotime command with geotime.lsp

* Remove commands from shell

* Add comment
2022-11-30 23:27:15 +01:00
Vincent Ollivier
3b519377c7
Fix panic on commands containing only spaces (#442)
* Fix panic on commands containing only spaces

* Add trim
2022-11-30 23:26:55 +01:00
Vincent Ollivier
6a75ff23a1
Fix panic in chess move parser (#446) 2022-11-30 23:26:35 +01:00
Vincent Ollivier
3be0a0c9a5
Add path to prompt (#444)
* Add path to prompt

* Change tilde position in font

* Update moros.png
2022-11-28 23:21:05 +01:00
Vincent Ollivier
b51b060ec1
Add size unit options to commands (#434)
* Add SizeUnit

* Add -b option to list

* Add -b option to disk usage

* Add -b option to memory usage

* Align size to the right

* Update net command

* Add decimal units
2022-11-11 10:41:29 +01:00
Vincent Ollivier
d0c8e161e7 Add comment 2022-11-10 09:26:26 +01:00
Vincent Ollivier
39fe99216f
Run clippy (#438) 2022-11-09 23:29:56 +01:00
Vincent Ollivier
23d622176c
Use git describe to display version (#437)
* Use git describe to print version at boot

* Add version command
2022-11-09 09:29:06 +01:00
Vincent Ollivier
7ee885200a
Fix process table panic (#435)
* Limit table scope

* Rename pid to id
2022-11-08 22:51:38 +01:00
Vincent Ollivier
778de3cfe0
Add compilation option to set memory size (#433) 2022-11-05 09:40:02 +01:00
Vincent Ollivier
cc2377f2e8
Update rust version (#432)
* Update rust version

* Fix compilation warning
2022-11-03 20:39:12 +01:00
Vincent Ollivier
8103d8e936
Fix editor delete (#429) 2022-11-01 18:22:00 +01:00
Vincent Ollivier
ab9b488a49
Update lisp doc and examples (#428)
* Update documentation

* Add macro?

* Rewrite and and or with macros

* Move string-join

* Update built-in autocompletion

* Use define instead of def in core and examples

* Add changelog to doc

* Move aliases to lib

* Add let macro

* Add caar cadr cdar cddr functions

* Add fixme

* Fix let macro
2022-11-01 11:02:50 +01:00
Vincent Ollivier
0037e24961
Add macro to Lisp (#425)
* Add expand to lisp

* Update tests

* Add quasiquote and unquote

* Rename Lambda into Function

* Add macro

* Fix function_env

* Dry code

* Add define-macro shortcut

* Add mac shortcut

* Refactor inner env

* Move expand to a module

* Add unquote-splicing

* Fix test

* Refactor tests

* Add function args symbol

* Fix typo

* Remove old append

* Add dotted pair

* Revert "Add dotted pair"

This reverts commit 10544b56d8.
2022-10-28 18:43:22 +02:00
Vincent Ollivier
f7f1bd85f1
Run clippy (#424) 2022-10-28 09:56:04 +02:00
Vincent Ollivier
4d0d742ff4
Update pc-keyboard from 0.5.1 to 0.6.1 (#423) 2022-10-27 07:04:50 +02:00
Vincent Ollivier
0a29f533b2
Add TCO to Lisp (#420)
* Add TCO to Lisp

* Add sum.lsp

* Fix tests

* Refactor code

* Run clippy

* Use tmp var

* Refactor tmp

* Replace Lambda Rc by Box Lambda

* Remove exp clone

* Run clippy

* Remove another exp clone

* Reorder matches

* Remove another clone

* Run clippy

* Remove to_vec

* Add comments
2022-10-24 10:44:17 +02:00
Vincent Ollivier
fcf3a7e72f
Add if and while to Lisp (#418)
* Change Lisp loop into while

* Rename define to def

* Replace cond by if

* Fix pi computation

* Fix number parsing error

* Fix or function

* Add test to while

* Rewrite test

* Add missing fun

* Add examples to doc
2022-10-21 10:10:14 +02:00
Vincent Ollivier
1717fe03db
Refactor Lisp (#417)
* Split lisp code

* Move macros

* Reorganize imports

* Move lisp completer

* Fix newlines
2022-10-18 09:26:16 +02:00
Vincent Ollivier
892b697bd3
Add BigInt support to Lisp (#415)
* Add bigint support to Lisp

* Remove Box

* Replace BigInt by i64

* Add back big int

* Work around big int errors

* Print floats with a dot

* Add conversion to f64

* Use Number#parse instead of double

* Add trigo functions to Number

* Add conversion from number to byte

* Add addition to Number

* Add multiplication to Number

* Add negation and substraction to Number

* Add division to Number

* Add reminder to Number

* Add pow to Number

* Fix tests

* Re-enable BigInt

* Add parsing and printing of BigInt

* Add sign

* Add operations on BigInt

* Fix compilation issues

* Add support for add and mul overflow

* Fix bigint conversion to and from str

* Add number-type function

* Add tests

* Add support for pow overflow

* Fix tests

* Add more checks for overflow

* Add check for division by zero

* Fix typo

* Return inf for large exponential operations

* Check for division by zero in modulo

* Add shift operations

* Rewrite comparisons

* Add lazy eval to cond expressions

* Add set fonction

* Add loop function

* Add pi example

* Add builtin pi example to shell

* Update allocation error messages

* Rewrite number conversions

* Remove debug output from pi example

* Move pi command to a dedicated file

* Rewrite bytes->number and number->bytes

* Update doc

* Move op impl to Number

* Add macros to dry code

* Add more macros

* Run clippy
2022-10-17 20:58:08 +02:00
Vincent Ollivier
ec57ff1540
Extend and refactor Lisp implementation (#412)
* Adopt a syntax closer to scheme

* Add parse and eval

* Replace Exp::Func with Exp::Primitive

* Refactor built in autocompletion

* Replace null by nil

* Fix test

* Update doc

* Bump version
2022-09-20 19:57:55 +02:00
Vincent Ollivier
1bafa2271c
Add apply to Lisp (#410)
* Replace mapcar by apply

* Add map and reduce to core lib

* Add pi.lsp example

* Fix tests

* Refactor pi-digits

* Move builtin join to core lib as string-join

* Rename decode-* and encode-* to *-decode and *-encode

* Update doc
2022-09-15 20:50:23 +02:00
Vincent Ollivier
5109608ea3
Add Conway's Game of Life (#409)
* Add the Game of Life

* Add seed interval

* Add option to load seed from file

* Add speed option

* Add a status bar at the bottom of the screen

* Refactor rules computation

* Refactor printing

* Add life to autocomplete list

* Fix autocomplete size

* Refactor file loading

* Add centinal.cells

* Add more cells files

* Add ^C to text editor

* Remove -f option

* Remove two patterns

* Remove extra newlines

* Remove code for comments

* Center cells
2022-09-10 10:57:55 +02:00
Vincent Ollivier
1f54cd5e2f
Improve shell (#405)
* Improve whitespace support in shell

* Add glob variable expansion

* Add panic command

* Add USER env var
2022-09-08 09:43:57 +02:00
Vincent Ollivier
7e3c0da53c
Add support for closing connections in request to HTTP server (#406)
* Parse request header

* Add Request#is_persistent

* Close connection when requested
2022-09-04 15:38:10 +02:00
Vincent Ollivier
1e8f9e357d
Exit from alloc errors after page fault in userspace (#404)
* Add debug mode to makefile

* Add page fault exit code

* Fix panic

* Remove warning

* Display error message only in user mode

* Disable debug

* Use alloc conditionally in hello command

* Use standardized style of error message for page fault

* Remove debuginfo from userspace binaries

* Add comment to the page fault issue

* Use default relocation model instead of static

* Refactor import

* Update binaries

* Fix panic info by using debug

* Refactor makefile comment
2022-09-03 15:36:53 +02:00
Vincent Ollivier
55531b9e3d
Improve Lisp forms (#402)
* Use x and y variables instead of a and b

* Rewrite not form

* Move boolean forms to core lib

* Handle special arithmetic cases

* Add range form

* Add pr and prn for print and println

* Add more tests to cond
2022-09-03 15:27:52 +02:00
Vincent Ollivier
7097de350a
Add more bytes to RNG seed when RDRAND is not available (#401)
* Add more bytes to RNG seed

* Reorder seed sources
2022-08-28 20:53:41 +02:00
Vincent Ollivier
e1be97167e
Add RTC device file (#400)
* Add RTC device file

* Add support for updating the RTC

* Handle 12 hour format

* Check date time

* Add device size
2022-08-28 18:38:48 +02:00
Vincent Ollivier
d5c0002f6d
Update shell redirections (#399)
* Update shell redirections

* Allow file truncation during redirection

* Print time output to stderr
2022-08-28 17:26:38 +02:00
Vincent Ollivier
5d0451e379
Improve http timeout (#397) 2022-08-28 17:26:13 +02:00
Vincent Ollivier
0724b5a07b
Move /ini/lisp to /lib/lisp (#398) 2022-08-27 13:07:32 +02:00
Vincent Ollivier
7f3baa2c60
Switch HTTP server to HTTP 1.1 (#395)
* Switch to connection keep-alive

* Upgrade to HTTP 1.1

* Add pcap to makefile
2022-08-27 12:36:20 +02:00
Vincent Ollivier
d965a72a81
Add cache to AtaBlockDevice (#396)
* Add cache to AtaBlockDevice

* Add methods for cached blocks

* Rename cache index to hash

* Add ATA_CACHE_SIZE

* Refactor code
2022-08-25 20:30:14 +02:00
Vincent Ollivier
b11f0aeb96
Add new forms to lisp (#385)
* Add decode-float and encode-float forms

* Add uptime form

* Add write-bytes form

* Add list form

* Add new forms to move print to core lib

* Rename file io forms

* Update doc

* Merge cat into string

* Rename *code-float to *code-number

* Add write-file and append-file forms

* Add doc about the core library

* Add regex-find

* Add not

* Add regex-match

* Update doc

* Bump lisp version

* Add realtime

* Update doc
2022-08-25 08:48:19 +02:00
Vincent Ollivier
f1a19e2055
Improve HTTP server (#391)
* Link host 8080 port to qemu 80

* Add root dir

* Add support for images

* Add Response struct

* Refactor response buffer creation

* Add index file support

* Copy www dir

* Update trailing slash rule

* Add command line arguments

* Remove strftime function

* Add read only mode

* Implement Display

* Add colored output

* Add Request struct

* Add common date time format

* Add time::now_utc

* Add connexions pool

* Reduce wait time

* Add install --yes

* Fix typo

* Add more mime types
2022-08-25 08:42:35 +02:00
Vincent Ollivier
6397faec44
Update users file (#389)
* Rename passwords.csv to users.csv

* Allow login with empty password
2022-08-17 17:41:56 +02:00
Toguy
149ab3ede8
ATA: Sata LBA2 wrong address (#388)
According to [this osdev page](https://wiki.osdev.org/ATA_PIO_Mode#Detecting_device_types), the address for the CH register (LBA2) for the SATA drives should be 0xC3 instead of 0x3C.
2022-08-15 00:13:38 +02:00
Vincent Ollivier
e0596f9f77
Add file append (#387)
* Add file append

* Fix off by one error

* Use append in reopen for shell redirections

* Add documentation

* Update tests
2022-08-14 01:12:52 +02:00
Vincent Ollivier
78756bb94e
Add Brautigan poem (#373) 2022-08-01 21:28:28 +02:00
Vincent Ollivier
c341aef9be
Fix variables expansion (#370)
* Add status env var

* Add variable_expansion function

* Add special case for status shortcut

* Remove debug

* Add test
2022-07-17 15:39:38 +02:00
Vincent Ollivier
79682d2302
Add tilde expansion to shell (#367)
* Add tilde expansion to shell

* Add tilde expansion to auto complete

* Move tilde expansion into split_args

* Add doc
2022-07-10 22:00:13 +02:00
Vincent Ollivier
2f25c4a1ef
Improve http command (#365)
* Fix host arg

* Add support for binary output

* Send binary data to stdout directly

* Remove header struct

* Refactor states

* Refactor arg match

* Add missing -v option

* Trim protocol from url

* Fix separator when listing root
2022-07-08 09:02:27 +02:00
Vincent Ollivier
2426d2ff94
Upgrade linked list allocator (#363)
* Bump linked_list_allocator from 0.9.1 to 0.10.0

Bumps [linked_list_allocator](https://github.com/phil-opp/linked-list-allocator) from 0.9.1 to 0.10.0.
- [Release notes](https://github.com/phil-opp/linked-list-allocator/releases)
- [Changelog](https://github.com/rust-osdev/linked-list-allocator/blob/main/Changelog.md)
- [Commits](https://github.com/phil-opp/linked-list-allocator/compare/v0.9.1...v0.10.0)

---
updated-dependencies:
- dependency-name: linked_list_allocator
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Convert HEAP_START addr to ptr

* Bump to 0.10.1

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-08 08:43:13 +02:00
Vincent Ollivier
3789a10df6
Improve lisp (#362)
* Parse empty strings

* Add append to core

* Add reverse to core

* Add read-line to core

* Remove prompt from read-line

* Change print return value

* Fix read-line

* Add trigonometric functions

* Update documentation

* Setup autocompletion semi-automatically
2022-07-02 15:24:30 +02:00
Vincent Ollivier
b202192810
Remove superfluous use of lazy_static (#364) 2022-06-30 07:15:58 +02:00
Vincent Ollivier
e4ce2ab59c
Use exit code to set status var (#360)
* Use exit code

* Add macro_use to sys module

* Replace ExitCode with Result<usize, usize>

* Add status var

* Fix status code

* Replace status with ?

* Fix regex for var substitution

* Remove warnings

* Add temporary fix for failing tests

* Add q shortcut to calc

* Use usize for exit code

* Use process exit codes

* Reintroduce ExitCode enum

* Use ExitCode::UsageError where needed

* Display usage error in find command

* Add doc
2022-06-29 19:23:01 +02:00
Vincent Ollivier
82882ec355
Add shell aliases (#357)
* Add shell aliases

* Fix env output error

* Fix sort

* Read aliases from config file

* Simplify arguments parsing

* Fix test

* Clone params to spawn syscall

* Run clippy

* Revert "Clone params to spawn syscall"

This reverts commit 4c91bea196.

* Disable binary stripping

* Remove exit alias

* Update doc
2022-06-26 10:00:54 +02:00
Vincent Ollivier
851bf65a8c
Fix args ptr alignment (#359)
* Update toolchain

* Rewrite args_ptr to fix alignment issue
2022-06-23 20:49:29 +02:00
Vincent Ollivier
629e254a51
Improve regex for redirections (#356) 2022-06-17 20:22:28 +02:00