Who is to blame ? Bochs or me ?
Posted: Wed Jun 30, 2010 4:29 am
Hi everybody !
Now that I've finally got long mode code to run, I'm currently in the process of fixing minor bugs, cleaning up code, and investigating strange behaviors.
Two things are puzzling me at the moment. I wonder if it's my code or Bochs which is to blame and wanted to ask here before reporting a bug on Bochs' website :
-> If a stack segment with its W bit cleared is loaded in long mode, bochs will triple fault because a non-writable stack segment has been loaded. Isn't this in direct contradiction with the AMD manual which reads "The expand-down (E), writable (W), and accessed (A) type-field attributes are ignored." (Vol 2, p.88) ?
-> In long mode, when displaying processor state, Bochs says : "[CPU0 ] CS.d_b = 16 bit". However, about the D bit, the AMD manual reads : "If the processor is running in 64-bit mode (L=1), the only valid setting of the D bit is 0. This setting produces a default operand size of 32 bits and a default address size of 64 bits. The combination L=1 and D=1 is reserved for future use." (Vol 2, p.87). Doesn't this mean that Bochs should say something like : "[CPU0 ] CS.d_b = op 32 bit, add 64 bit" ?
Now that I've finally got long mode code to run, I'm currently in the process of fixing minor bugs, cleaning up code, and investigating strange behaviors.
Two things are puzzling me at the moment. I wonder if it's my code or Bochs which is to blame and wanted to ask here before reporting a bug on Bochs' website :
-> If a stack segment with its W bit cleared is loaded in long mode, bochs will triple fault because a non-writable stack segment has been loaded. Isn't this in direct contradiction with the AMD manual which reads "The expand-down (E), writable (W), and accessed (A) type-field attributes are ignored." (Vol 2, p.88) ?
-> In long mode, when displaying processor state, Bochs says : "[CPU0 ] CS.d_b = 16 bit". However, about the D bit, the AMD manual reads : "If the processor is running in 64-bit mode (L=1), the only valid setting of the D bit is 0. This setting produces a default operand size of 32 bits and a default address size of 64 bits. The combination L=1 and D=1 is reserved for future use." (Vol 2, p.87). Doesn't this mean that Bochs should say something like : "[CPU0 ] CS.d_b = op 32 bit, add 64 bit" ?