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
2
votes
5 answers

Forking in a for loop clarification

I've seen lots of examples of forking in for loops on here, but not much clarification on how it does what it does. Lets use this simple example from an answer of How to use Fork() to create only 2 child processes? as an example. for (i = 0; i < n;…
Bob
  • 715
  • 2
  • 11
  • 32
2
votes
1 answer

Why Operating System need to create its own stack?

I am reading the multiboot specification of the grub in its manual.While I am reading this manual, I found an one specification.This specification mention as like "When the boot loader invokes the 32-bit operating system,operating system image must…
2
votes
1 answer

Initialize array in c in the format `int a[3]={0,};`

I had seen a source where array initialize in int arr[3] ={0,}; What does it mean ? I normally use this format int arr[3]={0}; can i know what is the difference
2
votes
1 answer

where can i find the header of __sync_add_and_fetch

can any one tell me where can I find the header for __sync_add_and_fetch built in function with out header how could we able to compile the code .
2
votes
0 answers

ATA IDE IDENTIFY

I am trying to develop ide ata driver for my os learning .. i am facing a problem that after sending IDENTIFY CMD the system hang up with no panic ..! i am using the below code /* ATA specs say these values must be zero before sending IDENTIFY…
2
votes
1 answer

Proper way to use stat() function to access m_time

My program takes user input and checks to see if a file was modified with in a minutes than the user input. I am trying to get the last modified time of the file using the stat() function as follows: Note: op_mmin is the user input in minutes struct…
Chuck
  • 53
  • 2
  • 8
2
votes
1 answer

Writing a custom IRB

I'm playing around with all sorts of small hardware. In an attempt to learn it. I would like to run mruby. I've compiled for my hardware. And have the framework as well as the include MIRB and MRUBY bins. But I would potentially like the code my…
csduarte
  • 191
  • 1
  • 1
  • 9
2
votes
0 answers

Can't establish more than about 1024 HTTP connections

I'm curious what limit I'm raised? I have the next code: import httplib, resource, socket, traceback print("NOFILE: %s" % str(resource.getrlimit(resource.RLIMIT_NOFILE))) socket.setdefaulttimeout(100000) conns = [] for _ in xrange(10000000): …
Ivan Velichko
  • 6,348
  • 6
  • 44
  • 90
2
votes
1 answer

How to lock a PIPE (or FIFO) with multiple reading processes?

Here is the scenario , My parent process has a range (a,b) and a number N.I want to compute all the primes between (a,b). But the processing part is done by N child processes. So , I create a pipe and then divide the range in N parts.(a1,b1) ...…
Tamim Addari
  • 7,591
  • 9
  • 40
  • 59
2
votes
0 answers

Interrupt causes protection faults

I have a oneline C program: int main(){asm volatile ("INT $0x06"::);} Once compiled, I execute it by sudo ./a.out However, it does not throw invalid instruction error (as expected, since 0x06 is invalid instruction interrupt). Instead, in dmesg,…
Richard
  • 14,642
  • 18
  • 56
  • 77
2
votes
1 answer

opendir will not accept string variable but will accept plain string

I cannot get this function to work, because for some reason opendir will not take buffer2 (declared as char buffer2[128]) as an argument properly. If I replace the variable with something like "." or "sample", it works perfectly. But doing it like…
Luca
  • 515
  • 5
  • 17
2
votes
6 answers

SysInternal's WinObj device listing mechanism

SysInternals's WinObj can list all device objects. I wonder how it can list the devices. Is there any open source we can read?(or a code snippet) What is the most significant function I should know?
Benjamin
  • 10,085
  • 19
  • 80
  • 130
2
votes
1 answer

pagesize and its ratio to 4096

Are there systems, where minimal page of memory (pagesize) has a size not divisible by 2, or by 1024, 4096? Can it be 3000 or 3500? Will any posix program break, if pagesize will be not divisible by 1024?
osgx
  • 90,338
  • 53
  • 357
  • 513
2
votes
3 answers

system calls using c library

Generally, systems provide a library or API that sits between normal programs and the operating system. On Unix-like systems, that API is usually part of an implementation of the C library (libc), such as glibc, that provides wrapper functions for…
saurav1405
  • 399
  • 3
  • 9
2
votes
2 answers

How to avoid race condition when checking if file exists and then creating it?

I'm thinking of corner cases in my code and I can't figure out how to avoid problem when you check if file exists, and if it does not, you create a file with that filename. The code approximately looks like this: // 1 status = stat(filename); if…
bodacydo
  • 75,521
  • 93
  • 229
  • 319