bewing's complete bochs rewrite: test request

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
stlw
Member
Member
Posts: 357
Joined: Fri Apr 04, 2008 6:43 am
Contact:

Re: bewing's complete bochs rewrite: test request

Post by stlw »

Combuster wrote:a prefix used in AMD's new 256-bit vector instructions
Intel's. AMD invented XOP instead.

Stanislav
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: bewing's complete bochs rewrite: test request

Post by Combuster »

Be advised then, AMD uses VEX as the official term for the 3-byte prefix, that happens to start with the XOP byte. (AMD software developer manuals, 256-bit instrucitons, chapter 1.1)

Edit: and as wikipedia suggests, VEX refers to the encoding scheme and not the implementation - 8F/C4/C5 are all possible first bytes for VEX prefixes, only used in different implementations.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Kevin
Member
Member
Posts: 1071
Joined: Sun Feb 01, 2009 6:11 am
Location: Germany
Contact:

Re: bewing's complete bochs rewrite: test request

Post by Kevin »

bewing, you just left IRC when I wanted to ping you about it, so let me report the bug here...

I noticed that the cursor keys don't work when I tried to edit the boot configuration in GRUB. The problem is that you cast an SDL keycode to a 8 bit type. In fact however, key codes are not limited to 0-255, and the cursor keys start at 273. This means that you even overflow sdl2rbx when you build the keymap during initialization. This should probably be fixed. ;)
Developer of tyndur - community OS of Lowlevel (German)
User avatar
Creature
Member
Member
Posts: 548
Joined: Sat Dec 27, 2008 2:34 pm
Location: Belgium

Re: bewing's complete bochs rewrite: test request

Post by Creature »

According to the wiki, Bochs fills memory with zeroes until it's overwritten. Though useful, it would be handy if this could be disabled. The reason for this is that hopefully it would speed up booting a bit (don't have to clear big amounts of memory) and it would be handy to test whether e.g. code has been making assumptions about memory or one forgot to clear a paging structure before use.
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: bewing's complete bochs rewrite: test request

Post by jal »

Creature wrote:According to the wiki, Bochs fills memory with zeroes until it's overwritten. Though useful, it would be handy if this could be disabled. The reason for this is that hopefully it would speed up booting a bit (don't have to clear big amounts of memory) and it would be handy to test whether e.g. code has been making assumptions about memory or one forgot to clear a paging structure before use.
I agree it would be useful for the latter - some random garbage would be way better. As for the first, I would hope that Bochs is smart enough to not claim and clear all memory at once, and do a "clear on access" strategy or the like. Also, clearing memory is relatively low cost, compared to say the time it takes to emulate harddrives (or even floppies!).


JAL
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: bewing's complete bochs rewrite: test request

Post by bewing »

Kwolf -- thanks for the tip. I'll fix that.

Creature -- Yes, rebochs already has this feature basically implemented. It's part of Nasty mode, for the bios. In benign mode, memory is zeroed. In nasty mode, if you enable it, all of memory is trashed with random garbage -- for precisely that reason.

jal -- initting memory at access time would be very slow, and I'm pretty sure that bochs does not
do that. I think it's zeroed from one end to the other. Thanks for the reminder, though -- I believe I will implement what you say in rebochs, as an option. But there is a reason why you shouldn't allocate more RAM for your OS testing than you need. :wink:
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: bewing's complete bochs rewrite: test request

Post by jal »

bewing wrote:jal -- initting memory at access time would be very slow, and I'm pretty sure that bochs does not
do that.
Well, if you are in PM, Bochs must check, on every memory access, whether that's paged in, whether the priviliges are ok, etc., so I wouldn't think that clearing memory (or at least a check for it) would be that big an overhead (on page level)?


JAL
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: bewing's complete bochs rewrite: test request

Post by Combuster »

And you should know that optimising means keeping code out of the critical path.

Seriously, in modern systems pumping out a gigabyte of zeros to RAM can already take less than a second. And then try loading grub from a floppy where every seek costs about as much.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: bewing's complete bochs rewrite: test request

Post by Owen »

Bewing, out of curiosity, have you considered implementing TLB entries in Rebochs?

It would be another feature for nasty mode (Though should probably be implemented in normal mode also) :twisted:
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: bewing's complete bochs rewrite: test request

Post by bewing »

jal -- yes, it's true that there are checks. I'd have to add a label to my linear_to_physical routine, so that all physical addresses could be checked at the end of the routine. Then have a (potentially)great big bitmap to check off, perheps several megs at a time -- because theoretically, memory can be many Gb in size, and it's not fixed, so I need to keep the bitmap size manageable. So it adds a dynamically allocated bitmap, some gotos, code to choose a byte out of the bitmap, and code to test the bit in the byte -- and all this code should probably be conditional, because I think I'd want it as a compile-time option (for speed efficiency).

Of course, there is more than one kind of efficiency. Delaying/avoiding the zeroing (or accessing) of sim memory allows the OS to delay actually allocating virtual pages to the sim -- which can be a huge savings if the sim is trying to allocate something really big -- which is likely.

Owen -- yes, the TLB is one of the pieces of "hardware" that I will be modeling when I get to it. It will have a "disable" line in the INI file when I have it implemented -- so that people can see how/where stale TLB entries make their code work differently.
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: bewing's complete bochs rewrite: test request

Post by Owen »

bewing wrote:Owen -- yes, the TLB is one of the pieces of "hardware" that I will be modeling when I get to it. It will have a "disable" line in the INI file when I have it implemented -- so that people can see how/where stale TLB entries make their code work differently.
I'd have it always check the page tables, and if they're wrong, scream at the user: "Virtual address mapping for 0xABCDEF12 is stale (Page table: X, TLB: Y)"
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: bewing's complete bochs rewrite: test request

Post by bewing »

Hmmm! Interesting thought! :) I'll contemplate that.
User avatar
quanganht
Member
Member
Posts: 301
Joined: Fri May 16, 2008 7:13 pm
Location: Hanoi, Vietnam

Re: bewing's complete bochs rewrite: test request

Post by quanganht »

I checked out from the svn and tried to build with msvc 2010, and eventuall get this:

Code: Select all

// HIHI!! this typedef doesn't exist yet!
What does it supposed to mean? :?
"Programmers are tools for converting caffeine into code."
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: bewing's complete bochs rewrite: test request

Post by qw »

The next line is even funnier:

Code: Select all

wBit8u_t* txt[] = {L"General Purpose",L"Segment",L"Control",L"MMX",L"SSE",L"Debug",L"Test",L"Other"};
A wide or word version of an 8 bits unsigned type that is initialized with wide strings?
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: bewing's complete bochs rewrite: test request

Post by Solar »

-1 for Hungarian Notation. :twisted: Perhaps he meant "word" to actually mean a "word" (as in "string")... 8)
Every good solution is obvious once you've found it.
Post Reply