Commit Graph

247 Commits

Author SHA1 Message Date
Philipp Oppermann
7be59b571d Use static and for loop for printing Hello World 2018-02-10 16:47:21 +01:00
Philipp Oppermann
bff0c4401c Print “Hello” instead of “OK” 2018-02-10 16:43:17 +01:00
Philipp Oppermann
9fc0a07453 Fix offset typo 2018-02-10 16:43:17 +01:00
Philipp Oppermann
5823bcb7ab Initial code for second edition 2018-02-10 16:42:51 +01:00
Philipp Oppermann
2629945c72 Delete code from first edition 2018-02-10 16:42:51 +01:00
Rob Gries
f7868a1bd8 Use proper size for heap init (#376) 2017-12-15 10:06:57 +01:00
Rob Gries
5e937e6e20 Panic on alloc::oom instead of calling intrinsics::abort (#375) 2017-12-15 09:20:50 +01:00
Isaac Woods
cf2c5550aa Fix sign extension bug in next_table_address (#372)
Fixes #362

Fix an issue where the left shift of the old table address would overwrite the sign extension, making the address non-canonical and leading to #GPs. This calculates the correct sign extension for the new table address.
2017-12-05 20:22:29 +01:00
Philipp Oppermann
e89e4f5277 Rewrite bump allocator and integrate it in main crate 2017-11-19 15:29:36 +01:00
Will
3e7aea0d51 Fix eh_personality linker errors (#364) 2017-11-14 15:21:14 +01:00
johanmon
30fcae9dce A rewrite of the bump allocator to conform to the new API (#361) 2017-10-24 08:31:08 +02:00
Philipp Oppermann
b58ee1e52b Add new const_unique_new feature gate (#355) 2017-10-03 13:29:22 +02:00
Will
0175e83387 Update to use the new API for custom allocators (#348)
* Update to new allocator API

* Change linked_list_allocator dependency to link directly to git repository

* Add Cargo.lock to gitignore
2017-08-20 19:36:30 +07:00
Tim Crawford
2ebd4ed954 Use new Unique API (#346)
Change Unique to use `new_unchecked`. Fixes #345.
2017-08-05 12:47:15 +08:00
Tim Crawford
e54cfa4378 Update bitflags to 0.9.1 (#347)
Signed-off-by: Tim Crawford <crawfxrd@gmail.com>
2017-08-05 12:33:56 +08:00
Philipp Oppermann
559a90ad8b Format using rustfmt-nightly 2017-06-20 18:09:09 +02:00
Philipp Oppermann
ff8e8e0f8b The collections crate was merged into the alloc crate (#333) 2017-06-20 17:41:28 +02:00
Philipp Oppermann
f3829346bc Unique::get/get_mut were renamed to as_ref/as_mut (#325) 2017-05-12 21:32:38 +02:00
Gil Mendes
0cb9be7c08 Merge pull request #296 from gil0mendes/expand-stack
Expand stack to 16k
2017-03-24 13:06:42 +01:00
Philipp Oppermann
02eaeb7af1 Switch to x86_64 crate and use its idt module 2017-03-15 16:58:15 +01:00
Philipp Oppermann
68dc7447f4 Run rustfmt 2017-03-09 17:50:44 +01:00
Philipp Oppermann
46100ba24b Update to latest bit_field version 2017-01-25 13:45:57 +01:00
Philipp Oppermann
fce85e68ee The ReadWrite flag isn't needed for code segments (#279) 2017-01-18 13:12:28 +01:00
Philipp Oppermann
8f8b46a9b6 Load null selectors to all data registers
This is required for some instructions such as iretq (ss must be valid or 0).
2017-01-14 16:38:33 +01:00
Philipp Oppermann
e179dadf70 Data segments aren't needed for 64-bit mode 2017-01-12 17:23:50 +01:00
Philipp Oppermann
1be2f42791 Make panic_fmt public to fix private_no_mangle_fns warning 2017-01-04 16:13:27 +01:00
Philipp Oppermann
a43b23b619 Catch double faults on a separate stack 2017-01-02 19:11:56 +01:00
Philipp Oppermann
006619920e Reload code segment register and load TSS 2017-01-02 19:11:56 +01:00
Philipp Oppermann
c0d7206249 Make TSS and GDT statics by using spin::Once 2017-01-02 19:11:56 +01:00
Philipp Oppermann
31ffe60052 Add a new GDT module 2017-01-02 19:11:56 +01:00
Philipp Oppermann
d330a67659 Create a new TaskStateSegment
(that contains the double fault stack in its IST)
2017-01-02 19:11:56 +01:00
Philipp Oppermann
e08bd375ae Allocate a new double fault stack in interrupts::init 2017-01-02 19:11:56 +01:00
Philipp Oppermann
8ad76ba496 Create a new MemoryAllocator (and initialize it) 2017-01-02 19:11:56 +01:00
Philipp Oppermann
4347ff235f Add a new stack_allocator module 2017-01-02 19:11:56 +01:00
Philipp Oppermann
47755d541d Trigger a stack overflow (still causes a triple fault) 2017-01-02 19:11:56 +01:00
Philipp Oppermann
dfa1cc48c9 Add a double fault handler (and trigger it) 2017-01-02 19:11:56 +01:00
Philipp Oppermann
7db15cf892 Reset source code to master again
(in order to follow the post and test the exact code from it)
2017-01-02 19:11:56 +01:00
Philipp Oppermann
c3bfcbcd8d Silence dead code warning 2016-12-30 14:52:04 +01:00
Philipp Oppermann
58e7cc77d0 Data segment descriptors are not needed in 64-bit mode 2016-12-30 14:52:04 +01:00
Philipp Oppermann
0b03c18b06 Rewrite interrupts::init using a lazy_static IDT again 2016-12-30 14:52:04 +01:00
Philipp Oppermann
3e6b1a8a35 Rewrite gdt module using an array instead of Vec 2016-12-30 14:52:04 +01:00
Philipp Oppermann
ceb44d9c2e Use x86's TaskStateSegment and use usize for stack pointers 2016-12-30 14:52:04 +01:00
Philipp Oppermann
ef786e1fe8 Update post and code 2016-12-30 14:52:04 +01:00
Philipp Oppermann
5f8de6e871 Create TSS and GDT modules and use a double fault stack 2016-12-30 14:52:04 +01:00
Philipp Oppermann
0cd2577abe Some code for double faults post 2016-12-30 14:50:53 +01:00
Philipp Oppermann
02697891e2 Update x86 crate to version 0.8.0 (#266) 2016-12-21 14:59:57 +01:00
Philipp Oppermann
c5dd983949 Mark panic_fmt as no_mangle to work around rust-lang/rust#38281 (#262) 2016-12-19 11:32:20 +01:00
Philipp Oppermann
e9735738f7 Fix panic_fmt arguments: file is a &'static str 2016-11-26 12:15:34 +01:00
Philipp Oppermann
15feb9a120 Use references for the ExceptionStackFrame argument
We require/assume that these pointers are correct. Using references is cleaner than blindly dereferencing raw pointers.

Important: The Rust book guarantees that: “At runtime, a raw pointer * and a reference pointing to the same piece of data have an identical representation.”
2016-11-01 16:56:11 +01:00
Philipp Oppermann
7a0bb1ff7b Print an empty line before exception error messages 2016-10-31 01:37:37 +01:00