Commit Graph

20 Commits

Author SHA1 Message Date
Vincent Ollivier dd5899a74d
Read command line args from userspace programs (#351)
* Read command line args from userspace programs

* Use Stop syscall to debug pointers from userpace

* Fix address translation system

* Update binaries

* Move print to bin

* Add hardcoded alias system

* Strip debug from binaries

* Build userspace binaries before running tests

* Save all the args in args including the command invocation name

* Move sleep command to /bin

* Rebuild binaries
2022-06-14 22:43:33 +02:00
Vincent Ollivier 6e3f3afcb0
Add binaries (#350)
* Remove linker args

* Add binaries

* Read /bin for autocomplete

* Add /bin path to commands

* Remove api bin

* Remove usr reboot
2022-06-12 15:28:54 +02:00
Vincent Ollivier cd2e0166e6
Executable loading (#349)
* Add header to binary

* Add result to spawn

* Use spawn result to display error message

* Use info result to change directory

* Fix binary detection

* Fix lock issue
2022-06-09 22:59:33 +02:00
Vincent Ollivier 429a14974c
Build only moros image (#340) 2022-05-11 09:47:11 +02:00
Vincent Ollivier a7cb32a5c2
Rewrite network interface (#334)
* Rewrite network interface

* Fix issue when cloning RLT8139 device

* Add Interface struct wrapping smoltcp iface

* Revert "Add Interface struct wrapping smoltcp iface"

This reverts commit ede7d5d0c9.

* Add back device stats

* Move stats code

* Rename eth_addr field to mac

* Add device config struct

* Fix usage of config and stats

* Make device init private

* Remove InnerStats and use Arc<Stats> directly

* Remove nic feature
2022-05-05 23:05:39 +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 0f70d67c91
Improve user experience (#274)
* Add default-run attribute

* Use f64 instead of f32 in calc

* Allow empty line in REPL

* Check that FS is mounted before reading superblock

* Add cmd env var

* Update changelog
2021-11-27 10:08:08 +01:00
Vincent Ollivier e75c287098
Add process table and exit syscall (#268)
* Add process table

* Add exit syscall

* Update binaries

* Make pid mutable

* Use RW lock for the process table

* Change pid atomic ordering

* Fix return code

* Fix lock issue

* Add debug print

* Add exit to sleep binary

* Enable asm_sym feature

* Use the end of code area for stack area

* Add debug macro

* Use array instead of vec for process

* Refactor process data clone

* Increase max file handles to 32

* Increase sleep to 5 seconds

* Fix MAX_PID calculation

* Revert max file handle value to fix crash

* Close file handle after dup syscall

* Remove init

* Run the test in release mode

* Refactor debug

* Refactor debug output of syscall

* Remove NULL syscall

* Save and restore stack frame

* Fix install

* Save only scratch registers to the stack

* Add write volatile to registers

* Overwrite rax register on exit

* Set pid back to 0 after exit

* Add alloc_page function

* Remove debug output

* Unmap pages after exit

* Allocate memory after kernel heap

* Hide unmap error
2021-11-27 09:56:52 +01:00
Vincent Ollivier d541ed949a
Add rust binaries support (#255)
* Parse elf segments instead of sections

* Add hello binary

* Build only kernel in makefile

* Add rust and nasm userspace examples

* Create empty files prior to compilation

* Change segment locations

* Simplify binaries

* Update binaries

* Update changelog

* Fix stack overflow
2021-10-14 09:49:30 +02:00
Vincent Ollivier 07ff76991a
Add basic userspace (#228)
* Testing userspace code

* Update program example

* Refactor code

* Read bin from dsk/bin at compile time

* Create mapper and frame allocator during process creation

* Read bin from disk at runtime

* Add missing file

* Add missing bin

* Add src bin

* Replace debug output by a test syscall+binary

* Remove comments from asm files

* Rewrite sleep

* Replace test by hello

* Refactor hello example

* Translate address from user code segment

* Rename entry label

* Update readme and changelog

* Use entry_name for DirEntry

* Increase stack size
2021-09-24 18:19:37 +02:00
Vincent Ollivier e55ff2446e
Add beep command (#234)
* Add beep command

* Add pc speaker to qemu

* Add source to beep musics

* Use beep -l instead of beep -t

* Reuse PIT manipulation from time module
2021-08-21 10:57:39 +02:00
Vincent Ollivier d706e973aa
Refactor filesystem (#225)
* Split fs file into multiple files

* Use DirEntry#into

* Reorganize dir entry creation prior to refactoring

* Refactor Block

* Refactor bits manipulation in Dir#create_entry

* Refactor ReadDir

* Truncate filename to 255 chars at most

* Refactor Dir#update_entry

* Refactor new block alloc

* Allow different kinds of block devices

* Display disk usage

* Add fs::read to API

* Add command to mount fs in memory

* Add tests
2021-08-07 11:29:45 +02:00
Vincent Ollivier 8f103f6b0b
Add keyboard layout change at runtime (#226)
* Change keyboard layout at runtime

* Add keyboard command

* Add env var to makefile

* Add azerty layout

* Fix tests

* Fix CI
2021-08-04 22:07:26 +02:00
Vincent Ollivier 9ca14297c5
Change vga font (#201)
* Add vga crate

* Rename vga option to screen

* Add fonts

* Add bold font weight

* Revert "Add bold font weight"

This reverts commit aa76cc9800.

* Rename screen output to video output

* Print extended ascii chars

* Fix http empty lines printing

* Add PSF fonts support

* Replace vga crate by internal method to set the font

* Add vga command

* Add psf font files
2021-07-13 22:10:02 +02:00
Vincent Ollivier a3e8e3cec4 Add make clean command 2021-02-04 10:06:06 +01:00
Vincent Ollivier 9d09d1b2ed
Add a web server (#114)
* Add HTTP server

* Update server code

* Support PUT method to update files

* Support DELETE method to delete files

* Add kernel::console::abort() to detect ^C

* Update network monitoring

* Drain console input after a program stopped

* Refactor loop exits

* Remove mut keyword

* Use MTU for TCP sockets buffer size

* Fix empty lines

* Support directory creation

* Use mtu for chunk size
2020-11-15 09:44:10 +01: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 f97191b272
Remove cargo xbuild (#83)
* Add nanowait based on calibrated rdtsc

* Add spin_loop_hint

* Update dependencies

* Update cargo config

* Add rlibc dependency to fix compilation bug

* Remove cargo xbuild

* Update crates

* Update readme
2020-07-31 10:31:59 +02:00
Vincent Ollivier 0a4b26a8bb
Improve filesystem (#24)
* Add doc about fs

* Add console on diskless boot

* Enumerate all disks

* Avoid hardcoded allocation of root dir

* Refactor ATA code

* Add BlockDevice

* Add mkfs command

* Update readme

* Add warning in the readme about disk modifications

* Use all bits inside BlockBitmap data

* Add makefile

* Overwrite only bootloader and kernel in disk image

* Update readme

* Add doc about mkfs

* Update mkfs command
2020-02-13 09:42:22 +01:00