<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="http://www.cs.put.poznan.pl/jkonczak/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel>
        <title>Jan Kończak os_cp</title>
        <description></description>
        <link>http://www.cs.put.poznan.pl/jkonczak/</link>
        <lastBuildDate>Tue, 05 May 2026 00:00:13 +0200</lastBuildDate>
        <generator>FeedCreator 1.7.2-ppt DokuWiki</generator>
        <image>
            <url>http://www.cs.put.poznan.pl/jkonczak/lib/tpl/dokuwiki/images/favicon.ico</url>
            <title>Jan Kończak</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/</link>
        </image>
        <item>
            <title>os_cp:assignments</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:assignments?rev=1684877130&amp;do=diff</link>
            <description>Assignment 1

Deadline: May 31st.

Collatz conjecture is an
open mathematical problem.


It boils down to a question whether the following procedure will terminate for
any value of x: 


typedef uint64_t natural_number;
void collatz(natural_number x) {
  while (x != 1) {                 // until you reach 1,
    if (x % 2)                     // if the number is odd,
      x = 3 * x + 1;               // multiply it by three and add one,
    else                           // else, if the number …</description>
        <category>os_cp</category>
            <pubDate>Tue, 23 May 2023 23:25:30 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:exec_dup</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:exec_dup?rev=1681854672&amp;do=diff</link>
            <description>Exec…

In order to run an executable file, an existing process has to 'exec' into it –
that is, the process has to ask the kernel to replace its memory with the code
(and data) of the executable file.


So, typically to start a new process, one has to</description>
        <category>os_cp</category>
            <pubDate>Tue, 18 Apr 2023 23:51:12 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:exercises-prog</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:exercises-prog?rev=1718110176&amp;do=diff</link>
            <description>Tentative weight for the question types:

	*  4 for explain a code and/or point a bug in the code.
	*  3 for write code or fill gaps in the code.
	*  2 set correct initial value for semaphores.
	*  3 for short, rather theoretical, questions.

The weights of the topics in the test will be scaled to the number of lab
classes for the topic, i.e., questions worth about half of the points will
deal with course materials from classes 7-9 covering threads, mutexes and
condition variables (that is three…</description>
        <category>os_cp</category>
            <pubDate>Tue, 11 Jun 2024 14:49:36 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:exercises-shell</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:exercises-shell?rev=1776295471&amp;do=diff</link>
            <description>In the exercises, one may also provide names of interactive programs (e.g., htop for process management, but if one chooses so, then one has to specify what needs to be done after starting the program in order to solve the exercise.


For instance, if the exercise states</description>
        <category>os_cp</category>
            <pubDate>Thu, 16 Apr 2026 01:24:31 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:files_processes</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:files_processes?rev=1773273623&amp;do=diff</link>
            <description>Copying, moving and erasing files



touch file
echo contents &gt; file
fortune &gt; file


touchecho&gt;




cat filename



Directories

mkdir dir creates a new directory.



mkdir -p dir1/dir2/dir3dir1dir2dir1dir3dir1/dir2


-pmkdir


To remove an empty directory one can use</description>
        <category>os_cp</category>
            <pubDate>Thu, 12 Mar 2026 01:00:23 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:find_out_what_is_going_on</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:find_out_what_is_going_on?rev=1683677099&amp;do=diff</link>
            <description>Yet another reason that makes concurrent programming harder.

Below, there is a piece of code that can be compiled by issuing:

gcc -g -O0 sb.c -o sb

The program forks and uses shared memory, so concurrency is involved.


Analyze the code and tell which results can be output.</description>
        <category>os_cp</category>
            <pubDate>Wed, 10 May 2023 02:04:59 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:find_out_what_is_going_on2</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:find_out_what_is_going_on2?rev=1777328952&amp;do=diff</link>
            <description>Yet another reason that makes concurrent programming harder.

Below, there is a piece of code that can be compiled by issuing:

gcc -g -O0 sb.c -o sb

Analyze the code and tell which results can be output.


Remember that global variables are by default zero-initialized.</description>
        <category>os_cp</category>
            <pubDate>Tue, 28 Apr 2026 00:29:12 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:fork_exec_pipes</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:fork_exec_pipes?rev=1747686430&amp;do=diff</link>
            <description>Fork

Forking

To create a new process, POSIX defines the fork function:

pid_t fork()



fork creates a copy
of the running process.


Upon success, fork returns the pid of the child process in the parent
process, and the value of</description>
        <category>os_cp</category>
            <pubDate>Mon, 19 May 2025 22:27:10 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:intro</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:intro?rev=1773273429&amp;do=diff</link>
            <description>Introduction



A bit of history

Terminal and console were a piece of hardware that let you interface with a computer.

	*  terminal: a combination of a keyboard and output device (such as a video display unit) by which data can be entered into or output from a computer or electronic communications system</description>
        <category>os_cp</category>
            <pubDate>Thu, 12 Mar 2026 00:57:09 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:locate_find</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:locate_find?rev=1774958922&amp;do=diff</link>
            <description>FHS


Filesystem Hierarchy Standard




hier
file-hierarchy


man hier

/bin/usr/bin/sbin/usr/sbin

/lib/usr/lib

/usr/share

/etc

/opt

/root/home

/tmp

/var


Searching files

locate

The locate tool 
looks up words or wildcard expressions provided as arguments in a previously
generated list of files.</description>
        <category>os_cp</category>
            <pubDate>Tue, 31 Mar 2026 14:08:42 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:open_fork</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:open_fork?rev=1681249407&amp;do=diff</link>
            <description>Creating, opening and closing files

To create or open a file, POSIX defines: 


int open(const char *pathname, int flags) 

int open(const char *pathname, int flags, mode_t mode)


and a creat function that is a shorthand to open(pathname, O_WRONLY|O_CREAT|O_TRUNC,</description>
        <category>os_cp</category>
            <pubDate>Tue, 11 Apr 2023 23:43:27 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:pipes_signals</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:pipes_signals?rev=1683667129&amp;do=diff</link>
            <description>Blocking vs non-blocking operations

Most POSIX functions complete in a limited number of steps.

But when the user invokes certain functions, then in well-defined circumstances 
it makes sense to wait until a particular thing happens.

For instance, when a</description>
        <category>os_cp</category>
            <pubDate>Tue, 09 May 2023 23:18:49 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:prog_assignment</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:prog_assignment?rev=1716318103&amp;do=diff</link>
            <description></description>
        <category>os_cp</category>
            <pubDate>Tue, 21 May 2024 21:01:43 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:prog_filebasics_signals</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:prog_filebasics_signals?rev=1747239615&amp;do=diff</link>
            <description>POSIX

POSIX – the Portable Operating System Interface standard – apart from
standardising shell and utilities, it also defines functions, macros,
and external variables to support applications portability at the C-language
source level.

POSIX specifies
what should be present in the</description>
        <category>os_cp</category>
            <pubDate>Wed, 14 May 2025 18:20:15 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:prog_intro_read_write</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:prog_intro_read_write?rev=1681249162&amp;do=diff</link>
            <description>Warm-up

 Create a program, compile it under the name prog.

 Print a static text with:

	*  C standard I/O library (#include &lt;stdio.h&gt;):
		*  printf,
		*  fprintf,

	*  POSIX write function (see man 3p write) that is made available by #include &lt;unistd.h&gt;</description>
        <category>os_cp</category>
            <pubDate>Tue, 11 Apr 2023 23:39:22 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:redirects_pipes</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:redirects_pipes?rev=1774359197&amp;do=diff</link>
            <description>Outputting file / text / sequences

Printing file contents

cat [file]... outputs input files one after another or outputs the
standard input if no files are specified.  

Name comes from concatenate. 

cat numbers lines with the -n switch and outputs non-printable characters
as</description>
        <category>os_cp</category>
            <pubDate>Tue, 24 Mar 2026 14:33:17 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:scripting</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:scripting?rev=1775681608&amp;do=diff</link>
            <description>Creating a shell script

(Non)interactive mode

The login shell in a terminal emulator runs in interactive mode.


When the shell executable is invoked with a file as its argument, it runs in
non-interactive mode, and reads the commands from the file rather than the
standard input.</description>
        <category>os_cp</category>
            <pubDate>Wed, 08 Apr 2026 22:53:28 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:semaphores</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:semaphores?rev=1683678209&amp;do=diff</link>
            <description>Semaphores

What is a semaphore

A semaphore is a mechanism to control concurrency. It has an associated number
that can be concurrently incremented and decremented by multiple processes / threads.
Incrementing a semaphore is instantaneous, and so is decrementing a semaphore which value is positive.</description>
        <category>os_cp</category>
            <pubDate>Wed, 10 May 2023 02:23:29 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:shmem_semaphores</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:shmem_semaphores?rev=1749059242&amp;do=diff</link>
            <description>Shared memory

It is possible for two processes to use the same physical address range of the
main memory.


Obviously any modification to such memory done by one process is visible to the
other processes that access the memory.


Such memory is called</description>
        <category>os_cp</category>
            <pubDate>Wed, 04 Jun 2025 19:47:22 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:tba</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:tba?rev=1741266406&amp;do=diff</link>
            <description>Editing the command line



Bash (as well as numerous other programs) uses the readline library to read commands from standard input.


Lots of software use for the same purpose the libedit library due to licensing reason.

The readline library is renown for providing comfortable, efficient and powerful editing capabilities within the input line as well as its built-in support for history of previously read lines.</description>
        <category>os_cp</category>
            <pubDate>Thu, 06 Mar 2025 14:06:46 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:threads</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:threads?rev=1745582142&amp;do=diff</link>
            <description>Threads

A process can run multiple threads – multiple flows of control.


In general, the threads share all resources (such as memory or open files).


Each thread uses a separate stack, and obviously has its own state of the CPU
registers. A limited set of properties might also be specific to a thread
(e.g., signal mask, CPU affinity).</description>
        <category>os_cp</category>
            <pubDate>Fri, 25 Apr 2025 13:55:42 +0200</pubDate>
        </item>
        <item>
            <title>os_cp:users_permissions</title>
            <link>http://www.cs.put.poznan.pl/jkonczak/os_cp:users_permissions?rev=1773867394&amp;do=diff</link>
            <description>Users and groups

In Unix-like systems there are users and groups. 

A user is identified by a numerical user identifier – uid. Uids are mapped to usernames.


A group is identified by a numerical group identifier – gid, that are likewise mapped to group names.</description>
        <category>os_cp</category>
            <pubDate>Wed, 18 Mar 2026 21:56:34 +0200</pubDate>
        </item>
    </channel>
</rss>
