low-level Questions

4

Solved

I know in linux it is as simple as /dev/sda but in Windows how do you open a disk and start reading data at the low level? In python I've tried: f = open("K:", "r") and I get this error: Trace...
Niveous asked 29/6, 2011 at 14:50

8

Solved

Any portable code that uses bitfields seems to distinguish between little- and big-endian platforms. See the declaration of struct iphdr in linux kernel for an example of such code. I fail to under...
Vinitavinn asked 18/5, 2011 at 10:50

11

Solved

Is it possible to divide an unsigned integer by 10 by using pure bit shifts, addition, subtraction and maybe multiply? Using a processor with very limited resources and slow divide.
Thespian asked 5/4, 2011 at 21:4

0

I'm developing a static freestanding nolibc/nostdlib program for Linux and would like to use the C compiler's memory, address and undefined behavior sanitizers to improve my code. I couldn't get it...
Buckie asked 19/12, 2023 at 23:11

1

Solved

I already learned that on the x86-64 platform using any 64-bit register would need a REX prefix, and any address less than 64 bits would require an address-size prefix. On x86-64 bit: E3 rel8 is jr...
Donothing asked 1/10, 2023 at 9:4

3

I need help in associating PHYSICAL_MONITOR which i get from GetPhysicalMonitorsFromHMONITOR with monitors DISPLAY_DEVICE.DeviceID (e.g. "\?\DISPLAY#GSM59AB#5&932a802&1&UID261#{e6f...
Averroes asked 26/7, 2020 at 1:25

1

Solved

I found that we can build/reconstruct an external pointer from a memory address, see this example where I take a pointer from a data table object and rebuild it: # devtools::install_github("ra...
Athalee asked 29/3, 2023 at 8:16

25

Solved

A friend and I are going back and forth with brain-teasers and I have no idea how to solve this one. My assumption is that it's possible with some bitwise operators, but not sure.
Pond asked 13/12, 2008 at 18:13

5

This is a follow-up to my question yesterday: CMS kindly provided this example of using bitwise operators to add two numbers in C: #include<stdio.h> int add(int x, int y) { int a, b; do ...
Authenticity asked 14/12, 2008 at 16:41

1

I want to find a way to get the ppid of a specific pid only using C low-level function. I know there is a way with bash commands, like "ps" etc, but I want to do it only in C language.
Caseous asked 8/9, 2022 at 12:26

3

I read a little bit and I find out that SSDT hooks using drivers in Windows 7 x64 systems are harder, on purpose because of Patch Guard/Driver Signing while in x32 systems that doesn't happen. So,...
Generality asked 22/7, 2012 at 5:6

5

Solved

I'm facing a quite tricky problem. I'm trying to get 2 virtual memory areas pointing to the same physical memory. The point is to have different page protection parameters on different memory areas...
Abundance asked 7/9, 2011 at 13:50

5

Solved

Which version is faster: x * 0.5 or x / 2 ? I've had a course at the university called computer systems some time ago. From back then I remember that multiplying two values can be achieved with com...
Saval asked 19/10, 2012 at 15:2

1

Solved

When we run a code, the compiler after compile "detects" the necessary amount of Stack memory? And with this, each program has its own "block" of stack memory. Or the stack memo...
Marchpast asked 18/10, 2021 at 23:52

1

Solved

When setting the mstatus.mpp field to switch to supervisor mode, I'm getting an illegal instruction exception when calling mret. I'm testing this in qemu-system-riscv64 version 6.1 with the riscv64...
Jumbled asked 10/9, 2021 at 14:35

3

Solved

I cannot really find anything interesting concerning this question, but I've been wondering for quite some time now how timers and delays in any programming language work at low level. As far as I...
Giraldo asked 2/11, 2012 at 17:5

3

I try to dive deeper and understand the differences between Public | Private | Protected in a low level perspective, in C++. How are the differences between the three expressed in the memory?
Dieldrin asked 8/12, 2020 at 13:27

2

Solved

I just implemented a Linux command shell in python using only the os library's low level system calls, like fork() and so on. I was wondering how I can implement a key listener that will listen for...
Replevin asked 23/9, 2020 at 20:45

2

Solved

I read this article about some low level underpinnings of C/C++, and the author is basically showing us through the assembly code generated by the compiler, line by line. He is using VS 2010, but I...
Score asked 8/3, 2012 at 14:28

11

Solved

I've seen a few questions and answers regarding to the endianness of structs, but they were about detecting the endianness of a system, or converting data between the two different endianness. Wha...
Brickey asked 18/7, 2011 at 11:21

2

Solved

Was reading the MDN docs regarding Wasm. They used the term WASM module quite a few times. Their definition was the following: A WebAssembly.Module object contains stateless WebAssembly code tha...
India asked 5/10, 2018 at 20:28

1

I get what typecasting in C is doing at a high level. I get that sometimes this is done implicitly, and sometimes is required to be done explicitly. However I don't know how this is happening in lo...
Ocher asked 29/4, 2020 at 18:50

1

Solved

The official documentation as well as tons of articles on the internet say that 'some string' is a primitive value, meaning that it creates a copy each time we assign it to a variable. However, th...

7

Solved

I'm trying to get a deeper understanding of how the low level operations of programming languages work and especially how they interact with the OS/CPU. I've probably read every answer in every sta...
Ewers asked 1/6, 2014 at 15:27

2

Solved

Consider the following example taken from Wikipedia, slightly adapted, where the steps of the program correspond to individual processor instructions: x = 0; f = 0; Thread #1: while (f == 0); p...

© 2022 - 2024 — McMap. All rights reserved.