OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 8:38 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 122 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9  Next
Author Message
 Post subject: Re: bewing's complete bochs rewrite: test request
PostPosted: Mon Aug 23, 2010 4:03 am 
Offline
Member
Member

Joined: Fri Apr 04, 2008 6:43 am
Posts: 357
Combuster wrote:
a prefix used in AMD's new 256-bit vector instructions


Intel's. AMD invented XOP instead.

Stanislav


Top
 Profile  
 
 Post subject: Re: bewing's complete bochs rewrite: test request
PostPosted: Mon Aug 23, 2010 3:24 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
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 ]


Top
 Profile  
 
 Post subject: Re: bewing's complete bochs rewrite: test request
PostPosted: Wed Sep 01, 2010 2:46 am 
Offline
Member
Member

Joined: Sun Feb 01, 2009 6:11 am
Posts: 1070
Location: Germany
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)


Top
 Profile  
 
 Post subject: Re: bewing's complete bochs rewrite: test request
PostPosted: Wed Sep 01, 2010 4:23 am 
Offline
Member
Member
User avatar

Joined: Sat Dec 27, 2008 2:34 pm
Posts: 548
Location: Belgium
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.


Top
 Profile  
 
 Post subject: Re: bewing's complete bochs rewrite: test request
PostPosted: Wed Sep 01, 2010 4:30 am 
Offline
Member
Member

Joined: Wed Oct 31, 2007 9:09 am
Posts: 1385
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


Top
 Profile  
 
 Post subject: Re: bewing's complete bochs rewrite: test request
PostPosted: Thu Sep 02, 2010 12:00 am 
Offline
Member
Member
User avatar

Joined: Wed Feb 07, 2007 1:45 pm
Posts: 1401
Location: Eugene, OR, US
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:


Top
 Profile  
 
 Post subject: Re: bewing's complete bochs rewrite: test request
PostPosted: Thu Sep 02, 2010 1:52 am 
Offline
Member
Member

Joined: Wed Oct 31, 2007 9:09 am
Posts: 1385
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


Top
 Profile  
 
 Post subject: Re: bewing's complete bochs rewrite: test request
PostPosted: Thu Sep 02, 2010 3:32 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
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 ]


Top
 Profile  
 
 Post subject: Re: bewing's complete bochs rewrite: test request
PostPosted: Thu Sep 02, 2010 8:12 am 
Offline
Member
Member
User avatar

Joined: Fri Jun 13, 2008 3:21 pm
Posts: 1700
Location: Cambridge, United Kingdom
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:


Top
 Profile  
 
 Post subject: Re: bewing's complete bochs rewrite: test request
PostPosted: Thu Sep 02, 2010 10:38 am 
Offline
Member
Member
User avatar

Joined: Wed Feb 07, 2007 1:45 pm
Posts: 1401
Location: Eugene, OR, US
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.


Top
 Profile  
 
 Post subject: Re: bewing's complete bochs rewrite: test request
PostPosted: Thu Sep 02, 2010 6:06 pm 
Offline
Member
Member
User avatar

Joined: Fri Jun 13, 2008 3:21 pm
Posts: 1700
Location: Cambridge, United Kingdom
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)"


Top
 Profile  
 
 Post subject: Re: bewing's complete bochs rewrite: test request
PostPosted: Fri Sep 03, 2010 12:07 am 
Offline
Member
Member
User avatar

Joined: Wed Feb 07, 2007 1:45 pm
Posts: 1401
Location: Eugene, OR, US
Hmmm! Interesting thought! :) I'll contemplate that.


Top
 Profile  
 
 Post subject: Re: bewing's complete bochs rewrite: test request
PostPosted: Mon Sep 13, 2010 3:32 am 
Offline
Member
Member
User avatar

Joined: Fri May 16, 2008 7:13 pm
Posts: 301
Location: Hanoi, Vietnam
I checked out from the svn and tried to build with msvc 2010, and eventuall get this:
Code:
// HIHI!! this typedef doesn't exist yet!


What does it supposed to mean? :?

_________________
"Programmers are tools for converting caffeine into code."


Top
 Profile  
 
 Post subject: Re: bewing's complete bochs rewrite: test request
PostPosted: Mon Sep 13, 2010 5:03 am 
Offline
Member
Member
User avatar

Joined: Mon Jan 26, 2009 2:48 am
Posts: 792
The next line is even funnier:
Code:
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?


Top
 Profile  
 
 Post subject: Re: bewing's complete bochs rewrite: test request
PostPosted: Mon Sep 13, 2010 8:02 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7612
Location: Germany
-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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 122 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 31 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group