Questions tagged [systems-programming]

System programming is the activity of computer programming system software. The primary distinguishing characteristic of systems programming when compared to application programming is that application programming aims to produce software which provides services to the user, whereas systems programming aims to produce software which provides services to the computer hardware.

Wiki:

System programming is a kind of computer programming which is intended to design a system software. Systems programming is used to produce such softwares which provide services to the computer hardware. thus It requires a greater extent of hardware compatibility.

Implementing certain parts in operating system and networking requires systems programming, for example implementing Paging (Virtual Memory) or a device driver for an operating system. A System programming language like C, PL360, BLISS, D is usually used to for systems programming".

Usage:

The tag can be used for all system programming related problems. Stackoverflow is a question-answer website for programming related problems, for theoretical and other problems you can ask your system programming problems on https://www.superuser.com and https://programmers.stackexchange.com/

Read more:

408 questions
3
votes
2 answers

Reading a child process's /proc/pid/mem file from the parent

In the program below, I am trying to cause the following to happen: Process A assigns a value to a stack variable a. Process A (parent) creates process B (child) with PID child_pid. Process B calls function func1, passing a pointer to a. Process B…
Amittai Aviram
  • 2,270
  • 3
  • 25
  • 32
3
votes
1 answer

How does a compiler identify its host machine's hardware? Which component?

My teacher told me that the intermediate code is generic for all systems but a component of the compiler then make it different according the system/environment the code is run on. Can someone please explain it.
3
votes
2 answers

Does wait(0) do anything when called from both processes created from fork()?

I'm trying to understand how fork works, and I know that when you call fork() another process is created that resumes from the exact same line with the heap and stack copied to it. For the parent, fork() returns the PID of the child and for the…
KiralyCraft
  • 109
  • 5
  • 16
3
votes
1 answer

Modification to "Implementing an N process barrier using semaphores"

Recently I see this problem which is pretty similar to First reader/writer problem. Implementing an N process barrier using semaphores I am trying to modify it to made sure that it can be reuse and work correctly. n = the number of threads count =…
3
votes
1 answer

Represent float using integer

The limit size of a BLE packet is 20 bytes. I need to transfer the following data over it: struct Data { uint16_t top; uint16_t bottom; float accX; float accY; float accZ; float qx; float qy; float qz; float qw; }; Size of Data is…
Dzung Nguyen
  • 3,794
  • 9
  • 48
  • 86
3
votes
2 answers

Changing a process name in runtime

For A.EXE PE file, if the program runs as test mode, I would like to change the process name to "A_TEST.exe". And if the program runs as safe mode, I want to change to "A_SAFE.exe" The file name must be same(A.EXE). Is it possible?
Benjamin
  • 10,085
  • 19
  • 80
  • 130
3
votes
1 answer

C read from named pipe doesn't end

In child, I write to fifo "sample" and read it in parent. In the code below, parent writes terminal "sample" and wait, it doesn't exit from read function. pid_t p; int fd; char str[]="sample"; char ch; mkfifo("myfifo", FIFO_PERMS); fd =…
user4612022
3
votes
2 answers

Lisp compiler design for embedded systems?

I am researching the development of a lisp compiler which targets embedded devices (16KB or so of RAM) and low level systems programming (i.e. Kernel modules), both of which necessitate complexity guarantees and access to low level constructs. Even…
3
votes
2 answers

Is there an AMD64-compatible CPU which does not support 2M pages?

Reviewing my bare-metal code which switches to long mode after loading by multiboot-compliant loader I realized that some CPUs don't support 1G-pages so I cannot simply use PML4 table + 1 PDP table entry to map 1:1 first 1G-page. Can I be sure that…
ababo
  • 1,490
  • 1
  • 10
  • 24
3
votes
2 answers

Boost Thread Specific Storage Question (boost/thread/tss.hpp)

The boost threading library has an abstraction for thread specific (local) storage. I have skimmed over the source code and it seems that the TSS functionality can be used in an application with any existing thread regardless of weather it was…
Hassan Syed
  • 20,075
  • 11
  • 87
  • 171
3
votes
3 answers

Unix system programming - unzipping a file programmatically

What I need to do is unzip a file, (.gz or .z), read the first line and do some stuff according to the first line read. But the C standard library doesn't seem to offer a way to do this. Is the a platform-independent way to do it?
helpermethod
  • 59,493
  • 71
  • 188
  • 276
3
votes
2 answers

C program to print its own address space?

I read cat /proc/[pid]/maps gives the informaion about its address space. So I want to write a program which will print its own address space. My program is this; pid_t pid; int fd; char *buf; pid = getpid(); fd = open("/proc/????/maps",…
gangadhars
  • 2,584
  • 7
  • 41
  • 68
3
votes
3 answers

mq_open giving "too many open files"

I created a message queue with following code. First few times it works properly. int main() { mqd_t mqdes; char mq_name[10] = "/mq"; int oflag = O_CREAT | O_RDWR, ret; struct mq_attr attr; attr.mq_maxmsg = 1024; …
gangadhars
  • 2,584
  • 7
  • 41
  • 68
3
votes
1 answer

What is cache size and cache line size?

I am trying to understand the following from a DTS file. Am very new to OS/Kernel. cpus { #address-cells = <1>; #size-cells = <0>; PowerPC,8313@0 { device_type = "cpu"; reg = <0x0>; d-cache-line-size = <32>; …
3
votes
1 answer

Is scala sufficient for native, system and kernel programming?

Is there a compiler that translates Scala code to native code? Is there a released compiler? Is there a compiler under development? If there is no such compiler, would it be possible to write one? If it is not possible: What are the reasons for…
user573215
  • 4,679
  • 5
  • 22
  • 25