low-level

(Non-Relational) DBMS Design Resource

Hey guys, As a personal project, I'm looking to build a rudimentary DBMS. I've read the relevant sections in Elmasri & Navathe (5ed), but could use a more focused text- something a bit more practical and detail-oriented, with real-world recommendations- as E&N only went so deep. The rub is that I want to play with novel non-relational ...

Why doesn't Linux use the hardware context switch via the TSS?

Hi guys! I read the following statement: The x86 architecture includes a specific segment type called the Task State Segment (TSS), to store hardware contexts. Although Linux doesn't use hardware context switches, it is nonetheless forced to set up a TSS for each distinct CPU in the system. I am wondering: Why doesn't...

Getting the start address of the current process's heap?

I am exploring the lower level workings of the system, and was wondering how malloc determines the start address of the heap. Is the heap at a constant offset or is there a call of some sort to get the start address? Does the stack affect the start address of the heap? ...

primitive ssh connection (lowlevel)

as a small (large) hobby project I've set out to make a (very primitive) ssh-2.0 client in C#. This is to explore and better understand DH and help flourish my encryption familiarities :) As per RFC 4253, I've begun the initial connection like this: (leaving out irrelevant presetting of vars etc.) Random cookie_gen = new Random(); whi...

How do I trap display driver drawing commands on Mac OS X?

I am trying to find a clean and elegant way to trap all display driver drawing commands on Mac OS X so I have visibility to anything that gets drawn on the screen, before it goes to the physical display driver. Simple bitmaps won't do it -- I need the actual drawing commands and not just notifications on which areas have changed. This ...

Scattered-write speed versus scattered-read speed on modern Intel or AMD CPUs?

I'm thinking of optimizing a program via taking a linear array and writing each element to a arbitrary location (random-like from the perspective of the CPU) in another array. I am only doing simple writes and not reading the elements back. I understand that a scatted read for a classical CPU can be quite slow as each access will cause...

Building an Operating System

Hello friends, I would like to build an operating system, it's one of my dreams. Before that I like to recreate ubuntu or debian or something else. but before that I need some advice and help from all my friends. I am stuck in how to start what languages I need to build theories behind an OS lots of queries etc etc etc. I am happy i...

What's the point of cache coherency?

On CPUs like x86, which provide cache coherency, how is this useful from a practical perspective? I understand that the idea is to make memory updates done on one core immediately visible on all other cores. This is a useful property. However, one can't rely too heavily on it if not writing in assembly language, because the compiler c...

reading the system clock value?

Is there a virtual/system clock running independently when a computer is booted? How can we read that value? ...

Low level hotkey kext to kill WindowServer?

I need to make a kext which does a very simple function. Whenever a key combination is pressed the kext should kill a process which happens to be "WindowServer" It has to be a kext due to the nature of the problem. It has to be independent from system's UI so if it hangs up, I can press this combination and restart it. Can someone pr...

Why are there so many different calling conventions?

Historically, why does it seem like just about everyone and their kid brother defined their own calling conventions? You've got C, C++, Windows, Pascal, Fortran, Fastcall and probably a zillion others I didn't think to mention. Shouldn't one convention be the most efficient for the vast majority of use cases? Is there ever any good re...

iPhone iOS4 low-level camera control?

Is there a way to manually set low-level still-camera settings like shutter speed, aperture, or ISO in iOS4 on the iPhone 4? I don't think it exists in the official SDK but perhaps someone has found some private APIs to allow this? I find my iPhone 4 camera to be unusable because even in fairly decent lighting, it always insists on shoo...

Intercept disk activity on the level of physical blocks

I suppose this should be possible via filter driver, but what type exactly I need? ...

Texture format for cellular automata in OpenGL ES 2.0

I need some quick advice. I would like to simulate a cellular automata (from A Simple, Efficient Method for Realistic Animation of Clouds) on the GPU. However, I am limited to OpenGL ES 2.0 shaders (in WebGL) which does not support any bitwise operations. Since every cell in this cellular automata represents a boolean value, storing 1 ...

Fast memmove for x86 and +1 shift (for Move-to-front transform)

Hi For fast MTF ( http://en.wikipedia.org/wiki/Move-to-front_transform ) i need faster version of moving a char from inside the array into the front of it: char mtfSymbol[256], front; char i; for(;;) { \\ a very big loop ... i=get_i(); \\ i is in 0..256 but more likely to be smaller. front=mtfSymbol[i]; memmove(mtfS...

How many bits to ignore when checking for NULL?

The following crashes with a seg-V: // my code int* ipt; int bool set = false; void Set(int* i) { ASSERT(i); ipt = i; set = true; } int Get() { return set ? *ipt : 0; } // code that I don't control. struct S { int I, int J; } int main() { S* ip = NULL; // code that, as a bug, forgets to set ip... Set(&ip->J); // gobs o...

Real low level sound generation in C#?

Hi. Anyone knows of a sensible way to create an ARBITRARY sound wave in C# and play it back from the speakers? This issue has been coming back to every now and then for years, I always end up giving it up after a lot of failure without finding a solution. What I want to do is like a reverse-visualizer, that is, I don't want to generat...

Is it possible to detect if the hardware display has completed the process of switching between display modes?

The reason I ask is because I just bought a new LCD that takes approximately 5 seconds to change between display modes, such as from 1920x1080x32bpp to 1280x800x32bpp. Does a programmatic solution exist to detect if the display is ready for video output? ...

Why do Java and C# have bitshifts operators?

Is the difference between integer multiply(temporarily forgetting about division) still in favor of shifting and if so how big is the difference? It simply seems such a low level optimization, even if you wanted it the shouldn't the (C#/Java) to bytecode compiler or the jit catch it in most cases? Note: I tested the compiled output for...

Analyze .exe/.dll (Windows PE) files for code bloats

Let's say I have a project with a dozen of different modules which produce one resultant DLL, how can I analyze it so that I can identify the actual file size that each module/functions contribute? I know it might be impossible with a Release build where much information has been stripped, but how about if I have the full source and can ...