Commit Graph

33 Commits

Author SHA1 Message Date
Vincent Ollivier cc2377f2e8
Update rust version (#432)
* Update rust version

* Fix compilation warning
2022-11-03 20:39:12 +01: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 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 e785942792
Update rust toolchain (#320)
* Update rust-toolchain file

* Remove stable features

* Update bootloader crate

* Remove toolchain from GitHub Actions

* Avoid running installer interactively

* Remove rustup component add commands
2022-04-05 12:03:31 +02:00
Vincent Ollivier e96f250c55
Display RTC during boot (#298) 2022-01-04 10:06:58 +01:00
Vincent Ollivier 237d78339f
Improve help (#291)
* Improve help command

* Impove disk --help

* Add find --help

* Add list --help

* Add net --help

* Improve pci --help

* Add beep --help

* Add http --help

* Fix http args parsing

* Add memory --help

* Add keyboard --help
2021-12-23 18:30:59 +01:00
Vincent Ollivier 8e828bb619
Enable asm_sym feature (#269) 2021-11-12 10:05:53 +01:00
Vincent Ollivier 71303cd455
Fix VGA issues with real hardware (#258)
* Enable cursor after boot

* Remove unused time attribute on file

* Fix compilation warning

* Clear screen after vga init

* Add disable_blinking function

* Set palette registers at boot

* Set default palette

* Fix attribute control registers initialization

* Clear palette address source bit when setting palette

* Refactor code

* Remove index from palette

* Update comment

* Update changelog
2021-10-24 18:23:01 +02:00
Vincent Ollivier 71d83cd688
Add dynamical disk information (#252)
* Add sys::ata::Drive struct

* Add fs size to superblock

* Add missing usage option to disk command

* Update changelog

* Store ata::Drive in AtaBlockDevice

* Store allocated block count in superblock

* Rename Superblock to SuperBlock

* Add superblock to memfs

* Use Block instead of LinkedBlock for BlockBitmap

* Rename BlockBitmap to BitmapBlock

* Fix removed const

* Remove some hardcoded constants

* Fix BitmapBlock::free_all

* Allocate the whole remaining disk space

* Use memory size to alloc memfs

* Dynamically use half of the memory for the heap

* Add SuperBlock::check_ata

* Move init to mod.rs

* Update python fuse

* Add BITMAP_SIZE constant

* Fix available space computation

* Limit the heap to 8 GB max

* Fix memfs size
2021-10-04 21:37:47 +02:00
Vincent Ollivier 1b4075bb3b
Enabe array_map feature (#254) 2021-10-02 22:01:38 +02:00
Vincent Ollivier c67ca13b51
Add ELF loader (#248)
* Add ELF loader

* Add elf reader

* Fix jump to entry point

* Update mapping code

* Update kernel data segment in GDT

* Refactor wrap macro

* Remove debug from process

* Remove jump to entry point

* Update hello binary

* Improve comments on asm code

* Rename Process#entry to Process#entry_point

* Use cli directly

* Add pic::init()

* Disable again interrupts after halt if needed

* Allow keyboard and serial events during memory init

* Update changelog
2021-09-26 22:50:45 +02:00
Vincent Ollivier 5e115ced6c
Fix clippy warnings (#214)
* Fix slow zero-filled vector initialization

* Fix warnings in user command

* Fix clippy error in httpd command

* Fix warnings about using print instead println

* Fix length comparison to zero

* Fix some clippy warnings

* Fix length comparison to zero

* Fix some clippy warnings

* Fix some clippy warnings

* Fix bug introduced by clippy
2021-07-25 12:41:44 +02:00
Vincent Ollivier 6826a9701d
Refactor print macros (#208) 2021-07-17 20:58:04 +02:00
Vincent Ollivier 6b8de261ca
Move kernel code to api (#204)
* Move code to api

* Add palette::from_csv

* Refactor palette::from_str with tests

* Add tests to api::font::from_bytes

* Add TODO comments to fs code

* Rename kernel and user dirs to sys and usr

* Add missing files from migration

* Move console::Style to api

* Add more missing changes
2021-07-16 10:19:18 +02:00
Vincent Ollivier f35ca06346
Add syscalls (#196)
* Add syscall handler

* Add syscall macro

* Add sleep syscall

* Remove unimplemented syscall numbers

* Add syscalls to MOROS API

* Refactor idt

* Add return value to syscalls

* Add uptime syscall

* Use match instead of table in dispatcher

* Remove syscall4

* Use naked function for syscall

* Enable interrupts while sleeping

* Use sysv64 calling convention

* Add realtime syscall

* Add basic documentation

* Update changelog
2021-07-03 15:47:20 +02:00
Vincent Ollivier 77b18650a3
Add tests (#118)
* Add custom test framework

* Avoid compiling rand crate in test

* Hide logs in test

* Add test command to the makefile

* Add travis file

* Use QEMU isa-debug-exit device

* Update travis script

* Add more tests

* Merge box alloc tests
2020-11-14 21:52:07 +01:00
Vincent Ollivier 07b58189aa
Add pcnet driver (#82)
* Update crates

* Move kernel::rtl8139 to kernel::net::rtl8139

* Refactor rtl8139 driver

* Add draft PCNET driver

* Add compilation option nic

* Add module file

* Move State to net

* Add draft implementation of smoltcp::phy::Device

* Rewrite RTL8139 to be shared between threads

* Copy buffer for RxToken

* Use only Device inside TxToken

* Fix error in packet transmission

* Update driver code

* Refactor driver

* Fix transmit packet length

* Fix number of descriptor entries setup

* Loop through owned receiver buffers

* Add ip set subcommand

* Fix MTU

* Refactor drivers

* Update readme
2020-10-31 23:20:41 +01:00
Vincent Ollivier 5828c7f4d3
Improve console (#74)
* Move keyboard key decoding to keyboard interrupt handler

* Read keys from serial

* Disable cursor in shell for serial

* Trim cpu brand string

* Use array for writer position

* Add Serial struct

* Add console::clear_row()

* Update autocomplete commands

* Parse ANSI color code

* Add colors to banner

* Remove newline before diskless mode

* Use lighter colors in banner

* Fix ansi color code parsing

* Use ansi colors in logger

* Rewrite colors command

* Add color to halt command

* Rewrite help command

* Use yellow color for titles

* User kernel::console::color() in shell

* Update screenshot

* Fix execute state in vte parser

* Fix typo

* Add colors to serial logger

* Fix banner colors

* Add some randomnly darker colors to banner

* Autocomplete devices path

* Create /ini/version.txt during install
2020-07-10 08:18:34 +02:00
Vincent Ollivier c9d56e6889
Improve installation and documentation (#73)
* Add kernel::fs::mount

* Check if fs is mounted before opening dir

* Save password hash during user creation

* Create home directory during user creation

* Improve path checking in mkfs

* Improve mkfs output

* Add install command

* Check presence of username and password during user creation

* Update documentation

* Check if user already exists before creation

* Split hashed_password

* Add save_hashed_password

* Rename login command to user

* Display MOROS version in a consistent way

* Use ctrl+d instead of ctrl+c to exit shell

* Rename mkfs to disk format

* Add disk list command

* Change prompt color if last command errored

* Improve installer

* Use $ and > prompts in doc

Use $ and > prompts in doc to indicate commands outside and inside
of MOROS respectively.
2020-07-05 13:31:49 +02:00
Vincent Ollivier 38fa72a8e4
Use VGA color palette (#15)
* Add kernel::vga::set_color

* Add log macro using vga colors

* Add Dark Gruvbox color palette

* Add kernel::vga::color

* Add colors command to show all colors
2020-02-03 09:33:30 +01:00
Vincent Ollivier 4fd7d68a63
Add network stack (#12)
* Display MAC address

* Add kernel::pci::find_device

* Mask lower bits of 16-bit Memory Space BAR

* Use array instead of vector for MAC address

* Split interrupts module

* Use IRQ constants instead of InterruptIndex enum

* Replace kernel::sleep by kernel::time

* Add kernel::idt::set_irq_handler

* Add interrupt handler for RTL8139

* Enable bus mastering for RTL8139

* Setup NIC

* Add features for vga/serial and qwerty/dvorak

* Add smoltcp crate

* Use EthernetAddress from smoltcp

* Add RTL8139 struct to implement smoltcp Device

* Save detected device

* Add kernel::mem::translate_addr

* Use physical address of rx_buffer

* Add command to read raw network data

* Parse packet header and length

* Fix missing ascii on last line

* Take CRC into account for packet length

* Fix compilation error

* Move buffer pointers after packet received

* Use buffer slice instead of clone in RxToken

* Add packet transmission and dhcp client

* Configure network interface with DHCP client

* Add debug mode to network interface

* Clean dhcp command output

* Add ip command

* Clean up commands output

* Count number of packets transmitted and received

* Add route command

* Add kernel::random::rand16

* Handle carriage return char

* Add HTTP client

* Improve http command output

* Add DNS resolver command

* Parse DNS responses to A IN queries

* Resolve http host

* Check if interface is ready before operations

* Add timeout to polling loops

* Fix sleep during polling

* Add verbose arg to http command

* Add State struct to Device struct

* Add subcommand config and dump to net command

* Add MTU to RX_BUFFER_LEN when using WRAP

* Fix first transmission index

* Refactor TxToken implementation

* Add user agent to http requests

* Add more comments to code

* Add llvm-tools-preview component to readme

* Add method to translate IRQ into system interrupt

* Clear IRQ mask in set_irq_handler

* Refactor driver code

* Sleep less rather than more

* Add rand32

* Disable RTL8139 interrupts

* Use arrays instead of vectors for buffers

* Add minimum sleep duration

* Add phy_addr to dry init

* Use CAPR and CBR to compute rx buffer offset

* Add debug for alloc issue with continuous physical memory

* Fix timeout in loops

* Add unused buffer to push the rx buffer into contiguous memory

* Add doc about network

* Update readme

* Add read /net/<proto>/<host>/<path> subcommand
2020-02-02 18:55:20 +01:00
Vincent Ollivier e761f26db4
Add heap allocation (#6)
* Add alloc

* Move allocator init to moros::init()

* Rename kernel::mem::init to mapper

* Add new kernel::mem::init

* Print version on boot
2020-01-18 20:48:01 +01:00
Vincent Ollivier 2d294ebe72
Add basic filesystem (#5)
* Add basic filesystem

* Fix duplicate call to shell in main loop

* Add file type and size to dir entry

* Add sleep after write to avoid failures

* Add list command

* Add dir creation

* Add comment to write dir command

* Move File struct

* Update readme

* Sort files by name in list command

* Create some default dirs

* Avoid opening dirs with File::open

* Create default dirs on the filesystem

* Update read command to mirror list for dirs

* Add delete command
2020-01-17 19:52:48 +01:00
Vincent Ollivier b77e02a472
Support disks in ATA PIO Mode (#3)
* Introduce ATA PIO

* Refactor drives detection

* Refactor drive identification

* Add read from disk

* Add write to disk

* Add Bus#setup to dry read/write code

* Add hex viewer
2020-01-12 08:56:29 +01:00
Vincent Ollivier 0f7e6bf686 Add CPU detection 2020-01-10 00:03:08 +01:00
Vincent Ollivier 51e192d55c Add PCI devices detection 2020-01-09 10:18:15 +01:00
Vincent Ollivier e36bfbf3de Add kernel::keyboard module 2020-01-05 20:32:20 +01:00
Vincent Ollivier 472887bfec Add sleep 2019-12-31 14:06:15 +01:00
Vincent Ollivier e51fa175ff Separate kernel and user code 2019-12-29 14:20:34 +01:00
Vincent Ollivier a2208aa20d Remove serial 2019-12-29 11:00:01 +01:00
Vincent Ollivier 2640520836 Add shell history 2019-12-29 10:34:08 +01:00
Vincent Ollivier 590990cb59 Add clock 2019-12-28 23:18:15 +01:00
Vincent Ollivier a6fd3d8a4e Start MOROS project 2019-12-28 18:37:49 +01:00