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
Philipp Oppermann
9b83b2853e
Remove print_error and use normal println in exception handlers
2016-10-30 16:51:59 +01:00
Philipp Oppermann
212dcfa592
Make print_error safe by using the global writer
...
This is now possible since we fixed the deadlock problem.
2016-10-30 16:51:59 +01:00
Philipp Oppermann
d96df500a7
Create a new print function and use it in the print macro
...
This fixes the deadlock problem, because the format_args is now evaluated before locking the screen writer. So `println!("{:?}", {println!("");})` no longer triggers a deadlock.
2016-10-30 16:51:59 +01:00
Philipp Oppermann
d7a445b1bb
Use volatile operations for accessing the VGA buffer
2016-10-06 23:57:26 +02:00
Philipp Oppermann
a04924955a
Add missing license headers and update copyright year ( #232 )
2016-10-02 18:20:48 +02:00
Philipp Oppermann
6eba03dd58
Update bit_field to 0.5.0 and use new API
2016-09-27 13:24:01 +02:00
Philipp Oppermann
00701ca474
Add code for “Returning from Exceptions”
2016-09-21 14:34:32 +02:00
Philipp Oppermann
3bd5e56e3f
Use upstream lazy_static and update once crate
2016-08-04 20:09:25 +02:00
Philipp Oppermann
46d41d9c3d
Add missing rsi clobber in code as well
2016-08-04 01:07:51 +02:00
Philipp Oppermann
d13460812d
Run rustfmt
2016-08-03 17:00:18 +02:00
Philipp Oppermann
a9319ea83e
Translate error code and print cr2 register
2016-08-03 17:00:18 +02:00
Philipp Oppermann
69f1b58bb0
Add and test a handler_with_error_code macro and a page fault handler
2016-08-03 17:00:18 +02:00
Philipp Oppermann
df1e39edb2
Add and test an invalid opcode handler function
2016-08-03 17:00:18 +02:00
Philipp Oppermann
71ebb23ec3
Add a handler macro that creates wrapper functions
2016-08-03 17:00:18 +02:00
Philipp Oppermann
e7ee1faaba
Add a wrapper function and print the exception stack frame
2016-08-03 17:00:18 +02:00
Philipp Oppermann
d97a8a3210
Silence dead code warnings
2016-08-03 17:00:18 +02:00
Philipp Oppermann
297f8442b9
Reset src to master to be able to follow step-by-step
2016-08-03 17:00:18 +02:00
Philipp Oppermann
398ba7a424
Provoke a page fault
2016-08-03 17:00:18 +02:00
Philipp Oppermann
261f92e2e5
Print cr2 in page_fault_handler
2016-08-03 17:00:18 +02:00
Philipp Oppermann
e9d2d594ab
Add handler! macros
2016-08-03 17:00:18 +02:00
Philipp Oppermann
40b565947b
Test the two-stage exception handler in code
2016-08-03 17:00:18 +02:00
Philipp Oppermann
2e0f4f9161
Begin code for upcoming post
2016-08-03 17:00:11 +02:00
Philipp Oppermann
2445b47661
Add aligned .got and .got.plt sections to linker script
2016-07-14 18:07:26 +02:00
Philipp Oppermann
e8b3a1fff1
Catch divide error instead of page fault
...
The divide error pushes no error code. Thus we avoid stack misalignment (see #184 ).
2016-06-25 17:12:04 +02:00
Philipp Oppermann
c9d8afe434
Run rustfmt
2016-06-25 17:08:26 +02:00
Philipp Oppermann
952f7ed5e3
Create dummy _Unwind_Resume function to fix libcore linker errors
2016-06-24 13:37:02 +02:00
Philipp Oppermann
76b83c623e
Revert "Remove unneeded gcc_except_table section" ( #180 )
2016-06-13 18:36:01 +02:00
Philipp Oppermann
1083ac9bac
Remove unneeded gcc_except_table section
2016-06-12 16:32:34 +02:00
Philipp Oppermann
f4eb589f19
We don't need _Unwind_Resume anymore
2016-05-29 18:00:58 +02:00
Philipp Oppermann
480265872d
Make methods of EntryOptions public
2016-05-29 17:24:21 +02:00
Philipp Oppermann
f58a6fe185
Add a print_error function, which works for exceptions inside println
2016-05-28 15:47:34 +02:00
Philipp Oppermann
c1df1d3354
Initialize the IDT and provoke a page fault
2016-05-28 15:47:34 +02:00
Philipp Oppermann
2d15a7bdb1
Make HandlerFunc public, because it is part of a public interface
2016-05-28 15:47:34 +02:00
Philipp Oppermann
c65b16f42d
Create a static IDT with a page fault handler function
2016-05-28 15:47:34 +02:00
Philipp Oppermann
b84c5822df
Create interrupt module with IDT submodule
2016-05-28 15:47:34 +02:00
Philipp Oppermann
e4b42b106f
Reset source code to master again
2016-05-28 14:09:45 +02:00
Philipp Oppermann
08540eb602
Remove unneeded unsafe
2016-05-28 14:09:17 +02:00
Philipp Oppermann
5054e48c9a
Remove unneeded pubs
2016-05-28 14:09:17 +02:00