Commit Graph

262 Commits

Author SHA1 Message Date
Jeremy Soller 6fef10bcb1 Merge branch 'master' of https://github.com/redox-os/kernel 2017-04-14 20:59:32 -06:00
Jeremy Soller a9d92df5fa Implement frame recycler 2017-04-14 20:59:27 -06:00
Jeremy Soller 903432f057 Fix issue with reusing temporary page frame 2017-04-14 20:59:01 -06:00
Jeremy Soller 7c1d5d8306 Disable SMP startup, fix issue with reusing trampoline frame 2017-04-14 20:58:23 -06:00
Jeremy Soller 0a72d1cbd8 Merge pull request #11 from pi-pi3/faster-externs
A faster implementation of the memcpy family
2017-04-14 16:49:58 -06:00
pi_pi3 5c1e619063 Avoid multiplication in memcpy family functions
Instead of multiplying everything by 8[/4], now addition is used. That
way code is prettier.
2017-04-14 14:51:04 +02:00
pi_pi3 c4fc76f844 A faster implementation of the memcpy family
The default implementation of the memcpy, memmove, memset and memcmp
functions in the kernel file `extern.rs` uses a naive implementation
by copying, assigning or comparing bytes ony by one. This can be slow.
This commit proposes a reimplementation of those functions by copying,
assigning or comparing in group of 8 bytes by using the u64 type and
its respective pointers instead of u8. Alternative version for 32-bit
architectures are also supplied for future compatibility with x86.
Both version first copy whatever they can with wide word types. The
tail, i.e. the final few bytes that do not fit in a dword or qword
are then copied byte by byte.

Here is a comparison of copying 64kiB (65536 bytes) on stack:

x86_64-unknown-linux-gnu: (64-bit)
       | naive (ns) | fast (ns) | speedup (x)
-------|------------|-----------|------------
memcpy |   204430   |   32994   |   ~6.20
memmove|   202540   |   33186   |   ~6.10
memset |   163391   |   23884   |   ~6.84
memcmp |   205663   |   34385   |   ~5.98

i686-unknown-linux-gnu: (32-bit)
       | naive (ns) | fast (ns) | speedup (x)
-------|------------|-----------|------------
memcpy |   206297   |   66858   |   ~3.09
memmove|   204576   |   70326   |   ~2.91
memset |   165599   |   50227   |   ~3.30
memcmp |   204262   |   70572   |   ~2.89

Copying on the heap behaves simmilarly.

All tests performed on Intel i5 6600K (4x4.2GHz),
ArchLinux Kernel 4.8.12-3 x86_64.
2017-04-14 14:37:32 +02:00
Jeremy Soller 56a533fbbc Add linker flavor 2017-04-13 19:46:48 -06:00
Jeremy Soller 4204d9905e Merge branch 'master' of https://github.com/redox-os/kernel 2017-04-11 21:27:44 -06:00
Jeremy Soller c4fb60f216 Implement script file support 2017-04-11 21:27:39 -06:00
Jeremy Soller d9e95448a4 Merge pull request #10 from xTibor/fix_initfs
Fix the listing of `initfs:` directories
2017-04-11 06:23:28 -06:00
xTibor 1f5bea611d Fix the listing of initfs: directories
There was a bug at the `initfs` generation which made the listing of the contents of the `initfs:`subdirectories impossible from the command line.

The subdirectory listing data had the full paths of the files (like `bin/ahcid\nbin/bgad\n...`) when it should just only be the names of the files (`ahcid\nbgad\n...`)
2017-04-11 05:26:10 +02:00
Jeremy Soller e43f5dda81 Implement timeouts
Cleanup utf8 path error handling
2017-04-08 21:59:30 -06:00
Jeremy Soller b286e69c9d Fix shutdown by disabling APs 2017-04-07 21:49:32 -06:00
Jeremy Soller a7f35e14cc Cleanup debug scheme 2017-04-05 20:11:51 -06:00
Jeremy Soller d26a9ee990 Fix goblin include 2017-04-05 19:10:17 -06:00
Jeremy Soller e860c9efdc Merge pull request #9 from redox-os/refactor
Refactor
2017-04-05 17:36:36 -06:00
Jeremy Soller 2087544ea7 Move all files to src 2017-04-03 21:47:01 -06:00
Jeremy Soller ff93e9cb82 Cleanup some 2017-04-03 21:16:50 -06:00
Jeremy Soller be7f8d64e6 Increase kernel heap, use crates version of goblin 2017-04-01 21:10:55 -06:00
Jeremy Soller cbacd0eea7 Merge pull request #7 from AdamNiederer/patch-1
Fix spelling & grammar in README.md
2017-03-27 06:56:01 -06:00
Adam Niederer 0ae08c52f6 Fix spelling & grammar in README.md 2017-03-26 22:51:28 -04:00
Jeremy Soller 7817122662 Loop on serial input
Fix issue with serial and cascade interrupts not being ackd
2017-03-24 20:38:02 -06:00
Jeremy Soller 906ef94ffd Fix bug with sleep - wake is not cleared after it occurs
Do not initialize waitcondition with capacity
2017-03-21 20:30:46 -06:00
Jeremy Soller ffd7594971 Disable century register for now 2017-03-20 21:47:18 -06:00
Jeremy Soller 228cd79cd4 Refactor ACPI, implement poweroff correctly using the DSDT in ACPI 2017-03-19 16:45:19 -06:00
Jeremy Soller e726234bc6 Fix style of new ACPI code, reduce warnings 2017-03-19 09:34:54 -06:00
Jeremy Soller 643e1f6552 Merge pull request #6 from CWood1/rtc-century
Implemented reading from RTC Century counter in x86_64 arch, if available
2017-03-19 07:29:30 -06:00
Connor Wood f79424aeac Fully implemented reading the RTC century counter, and laid out initial infrastructure for ACPI information to be used across the kernel, in the x86_64 architecture.
- Implemented a global variable, ACPI_TABLE, behind a mutex, which contains the ACPI information pertinent to the rest of the kernel, currently solely containing a pointer to the FADT.
- Split device initialization into two categories - "core" devices, such as the PIC and local APIC, necessary for initializing the rest of the kernel, and "non-core" devices such as serial and RTC, which are to be initialized last.
- Checked for the presence of the century register, and consequentially read from, in the RTC code, now factored into the date calculation. The location of the register is pulled from the "century" field in the FADT.
- Modified page unmapping in the ACPI code, such that any tables to be stored globally (currently only the FADT) are not unmapped after reading, such that they can be stored in globally accessible pointers without causing page faults.
2017-03-18 16:08:45 +00:00
Connor Wood 661ebb6390 Saved FADT in a pointer accessible elsewhere in the kernel 2017-03-18 15:12:42 +00:00
Jeremy Soller 1d5c7d6a4e Merge branch 'master' of https://github.com/redox-os/kernel 2017-03-16 22:50:16 -06:00
Jeremy Soller 05bb497fe4 Use normal EOI mode 2017-03-16 22:50:09 -06:00
Jeremy Soller ab4193d4fc Merge pull request #5 from tones111/cpuid_panic
Prevent cpuid get_extended_function_info panic
2017-03-16 22:15:02 -06:00
Paul Sbarra d667fa61e6 Prevent cpuid get_extended_function_info panic
A kernel panic occurs on some CPUs (notably qemu-system-x86_64) when
calling rust-cpuid's get_extended_function_info.  This is fixed upstream
in commit c3ebfc553cdff98d19d29777fd85c4f9182bfb66 but has yet to make
it crates.io.

The panic can by triggered by running "ls sys:" from ion and causes
redox to become unresponsive.
2017-03-16 22:32:57 -05:00
Jeremy Soller 7dd8de777d Merge pull request #3 from kolipka/standalone_support
Remove hardcoded initfs folder
2017-02-27 11:18:03 -07:00
Konrad Lipner 5ccbd788f3 Remove hardcoded initfs folder
initfs folder should be specified in INITFS_FOLDER environment variable
As a result kernel module can be compiled on it's own.
2017-02-15 21:54:38 +01:00
Jeremy Soller b9793deb59 Disable secondary processors with hlt 2017-02-13 22:15:42 -07:00
Jeremy Soller 473a7b6832 USe auto-eoi mode, mask off interrupts that happen and allow userspace to clear the mask 2017-02-11 21:09:16 -07:00
Jeremy Soller 0e22ba24be Initialize PIC in Rust 2017-02-11 20:54:14 -07:00
Jeremy Soller 571b2aa2e7 Add reminder 2017-02-07 22:14:53 -07:00
Jeremy Soller 776bb83a70 Unstick system by acknowledging IRQs on boot 2017-02-07 22:14:28 -07:00
Jeremy Soller be43673df6 Merge pull request #2 from little-dude/master
remove unused #[macro_use]
2017-01-24 12:48:08 -07:00
Corentin Henry 4d2499e4d3 remove unused #[macro_use] 2017-01-24 11:14:12 -08:00
Jeremy Soller 0d3aa234ff Add target definitions 2017-01-16 10:10:16 -07:00
Jeremy Soller 04d9d6b40a Specify crates.io versions 2017-01-13 15:09:56 -07:00
Jeremy Soller 35c2297724 Fix from @yoric - incorrect initialization of spin loop 2017-01-11 13:59:10 -07:00
Jeremy Soller ed69fac232 Allow memory: to be accessed in all namespaces 2017-01-10 09:59:30 -07:00
Jeremy Soller ba4588e84f Simplify path parsing 2017-01-10 09:22:59 -07:00
Jeremy Soller 433746e13c Move skipping to loop encompasing entire path 2017-01-10 09:19:02 -07:00
Jeremy Soller e20135575c Refactor to move alloc_kernel in tree, and move io into syscall 2017-01-09 20:35:54 -07:00