Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update paging-dev #33

Merged
merged 27 commits into from
Jun 11, 2016
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
14cd2e7
[x86_all] oops, segment descs are the same on 64 and 32-bits
hawkw Jun 4, 2016
486e41e
[x86_64] start on GDT, TSS
hawkw Jun 4, 2016
7cfc39f
[kernel] make type names in elf module conform to style guide
hawkw Jun 7, 2016
e41ef1a
[kernel] ELF section header parsing panics somewhat less frequently
hawkw Jun 7, 2016
2f0d2f3
[kernel] more ELF stuff returns ElfResult
hawkw Jun 7, 2016
127564e
[kernel] Hopefully make ELF parsing a bit more typesafe
hawkw Jun 7, 2016
d33e28d
[alloc,intrusive] remove unused var warnings on unimplemented fns
hawkw Jun 7, 2016
016cd4a
[kernel] begin on moving alloc stuff into kernel crate?
hawkw Jun 7, 2016
4c2c7ae
[alloc] remove unused mut from tests
hawkw Jun 7, 2016
2cc377f
[alloc] re-add mut that was actually needed to tests
hawkw Jun 8, 2016
e5845b6
[x86_all] make IDT gate flags much better
hawkw Jun 8, 2016
2728d4f
[kernel] quick function for checking ELF amgic
hawkw Jun 8, 2016
ed69a96
[kernel] don't compile panic_fmt for tests
hawkw Jun 8, 2016
225a7d6
[x86_all] nice bit flags for CR4
hawkw Jun 9, 2016
2396842
[x86_all] Namespace control registers nicer with modules
hawkw Jun 9, 2016
3369c0a
[x86_all] fix issue with bitflags in inline asm
hawkw Jun 9, 2016
678202c
[x86_all] add nicer bit flags for %cr0 as well
hawkw Jun 9, 2016
bd72607
[x86_all] %cr4 bit flags embetterment
hawkw Jun 9, 2016
8c7f320
[x86_all] we can write flags now
hawkw Jun 9, 2016
fb3eb3f
[x86_all] %rflags gets nice bitflags too
hawkw Jun 9, 2016
92f85c2
[x86_all] fix LLVM error in code for accessing %rflags
hawkw Jun 9, 2016
b71a9aa
[x86_all] nicer accessors/mutators for CPU flags
hawkw Jun 9, 2016
5126415
[x86_all] function to get IOPL actually works npw
hawkw Jun 9, 2016
e30b142
[x86_all] add CPU timer API
hawkw Jun 9, 2016
7d6caf8
[kernel, x86_all] remove unused imports
hawkw Jun 9, 2016
47ffc74
[x86_all] add tests for IDT gate numbers
hawkw Jun 9, 2016
27f34b0
[vga, x86_all] update slice patterns to use new syntax
hawkw Jun 11, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[kernel] more ELF stuff returns ElfResult
  • Loading branch information
hawkw committed Jun 7, 2016
commit 2f0d2f36d7b1e6e6f2fba00b9a0de4de20a28639
10 changes: 4 additions & 6 deletions src/elf/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
//
use ::memory::PAddr;

use super::Section;
use super::section;
use super::{ElfResult, Section, section};

use core::fmt;
use core::mem;
use core::{fmt, mem};

/// An ELF file header
#[derive(Copy, Clone, Debug)]
Expand All @@ -39,7 +37,7 @@ pub struct Header {
impl Header {

/// Attempt to extract an ELF file header from a slice of bytes.
pub fn from_slice<'a>(input: &'a [u8]) -> Result<&'a Header, &str> {
pub fn from_slice<'a>(input: &'a [u8]) -> ElfResult<&'a Header> {
if input.len() < mem::size_of::<Header>() {
Err("Input too short to extract ELF header")
} else {
Expand All @@ -49,7 +47,7 @@ impl Header {

/// Attempt to extract a section header from a slice of bytes.
pub fn section<'a>(&'a self, input: &'a [u8], idx: u16)
-> Result<&'a Section, &str>
-> ElfResult<&'a Section>
{
if idx < section::SHN_LORESERVE {
Err("Cannot parse reserved section.")
Expand Down