nhruo123 wrote:
I am kinda new to rust
See, I don't know Rust at all. I only know C well. I am passable at C++ and other C-based languages (e.g. C#), but the language I use for everything is C. I like Haskell, but I'm terrible at it. But still I could understand enough of your code to see that the PCI accesses were misaligned.
nhruo123 wrote:
and for some reason rust won't let you put packed and aligned on a struct so I assumed packed implies aligned as well.
I seriously dislike the packed attribute. Better to just understand padding rules and use the correct data types. E.g my TSS type is just
Code:
struct splitptr {
uint32_t low, high;
};
struct tss {
uint32_t res0;
struct splitptr
rsp0,
rsp1,
rsp2,
res1,
ist1,
ist2,
ist3,
ist4,
ist5,
ist6,
ist7,
res2;
uint16_t res3, ioploff;
};
No alignment or packing directive required.
nhruo123 wrote:
I found out I have an Intel 82562GT, but I couldn't find a manual for it,
I found a manual that says the card is part of the IO controller hub. I would search for a data sheet for that one. They often have all of the registers.