Andreas Kling
07c3cc01ec
LibC: Move wait-related stuff to <sys/wait.h>. #POSIX
2019-05-30 15:12:09 +02:00
Andreas Kling
c1f8df5f86
LibC: Don't define ALWAYS_INLINE if it's already defined.
...
This makes building GCC a bit quieter.
2019-05-28 21:04:47 +02:00
Robin Burchell
0dc9af5f7e
Add clang-format file
...
Also run it across the whole tree to get everything using the One True Style.
We don't yet run this in an automated fashion as it's a little slow, but
there is a snippet to do so in makeall.sh.
2019-05-28 17:31:20 +02:00
Andreas Kling
ab9db3a717
LibC: Move size_t, ptrdiff_t and NULL to stddef.h. #POSIX
2019-05-28 14:29:51 +02:00
Andreas Kling
cbd858544d
LibC: Move struct timeval to sys/time.h. #POSIX
2019-05-28 13:48:06 +02:00
Andreas Kling
f490ce0fb5
LibC: Implement wait() as a wrapper around waitpid().
2019-05-22 13:21:17 +02:00
Andreas Kling
4aef87a9a4
LibC: First pass of compat work / stubs while trying to build OpenSSL.
2019-05-21 21:36:08 +02:00
Andreas Kling
ae470ec955
Kernel: Add getpeername() syscall, and fix getsockname() behavior.
...
We were copying the raw IPv4 addresses into the wrong part of sockaddr_in,
and we didn't set sa_family or sa_port.
2019-05-20 20:33:03 +02:00
Andreas Kling
b3a1671f1a
Kernel: Add support for recv() with MSG_DONTWAIT.
...
Passing this flag to recv() temporarily puts the file descriptor into
non-blocking mode.
Also implement LocalSocket::recv() as a simple forwarding to read().
2019-05-20 03:47:02 +02:00
Andreas Kling
212a263f0a
Kernel+LibC: Implement getsockname() syscall.
2019-05-19 19:55:27 +02:00
Robin Burchell
4dad585609
LibC: Allow {AF,PF}_UNIX as well as {AF,PF}_LOCAL
...
Seems that these are equivilent. POSIX specifies _LOCAL, but a lot of
software uses _UNIX.
2019-05-16 14:03:49 +02:00
Robin Burchell
619489da62
LibC: Define a SOMAXCONN value in socket.h
...
No idea if this is sensible; but some software will look for it.
2019-05-16 14:03:49 +02:00
Andreas Kling
c1b025b5a6
LibC: Oops, I forgot to commit sys/uio.{cpp,h} yesterday.
2019-05-10 17:38:51 +02:00
Andreas Kling
0c898e3c2c
Put assertions behind a DEBUG flag to make it easy to build without them.
2019-04-23 21:52:02 +02:00
Andreas Kling
5451178c63
LibC: Minor compat tweak, move struct timezone to sys/time.h
2019-04-21 02:59:20 +02:00
Andreas Kling
aef6030a80
LibC: Time-related POSIX compliance fixes.
2019-03-27 01:31:53 +01:00
Andreas Kling
68f3771e4f
LibC: Minor socket-related compat fixes.
2019-03-14 13:03:32 +01:00
Andreas Kling
7aba68d51c
Userland+LibC: Add a new little "tc" program for testing TCP.
...
Also added send() and recv() to LibC in support of this. They are just
wrappers around sendto() and recvfrom().
2019-03-13 17:33:40 +01:00
Andreas Kling
19a51132f5
Kernel: recvfrom() should treat the address arguments as outparams.
2019-03-13 14:47:21 +01:00
Andreas Kling
b59d588c04
Kernel: Start fleshing out an UDP implementation.
2019-03-13 14:22:27 +01:00
Andreas Kling
562663df7c
Add support for socket send/receive timeouts.
...
Only the receive timeout is hooked up yet. You can change the timeout by
calling setsockopt(..., SOL_SOCKET, SO_RCVTIMEO, ...).
Use this mechanism to make /bin/ping report timeouts.
2019-03-13 13:15:05 +01:00
Andreas Kling
cf250e1245
More work on IPv4 sockets and /bin/ping.
...
It's now actually possible to ping other hosts on the network! :^)
I've switched the "run" script over to starting QEMU with user networking
since that works better for my testing needs right now.
2019-03-13 03:26:01 +01:00
Andreas Kling
a7d5e9781a
Kernel+LibC+Userland: Yet more networking bringup hacking.
...
All ICMP sockets now receive all ICMP packets. All this buffering is gonna
need some limits and such.
2019-03-12 17:27:07 +01:00
Andreas Kling
a017a77442
Kernel+LibC+Userland: Start working on an IPv4 socket backend.
...
The first userland networking program will be "ping" :^)
2019-03-12 15:51:42 +01:00
Andreas Kling
3f29a12d90
More compat work. Rename libraries from LibFoo.a => libfoo.a
...
This makes it more straightforward to build a cross-compiler toolchain.
Also move math stuff from LibC to LibM.
2019-02-26 13:30:57 +01:00
Andreas Kling
cccc8d8aeb
More compat work.
...
Move syscall to int 0x82 since using int 0x80 was kinda prone to fork bombs
when building things on Linux. :^)
2019-02-26 12:57:02 +01:00
Andreas Kling
93c0dfd1d7
LibC: A bunch of compat work towards porting GCC.
2019-02-24 15:20:07 +01:00
Andreas Kling
d7753c7c8d
Move over to building all of userspace with i686-pc-serenity-g++.
2019-02-22 14:45:14 +01:00
Andreas Kling
75b100673f
Switch over to building everything with i686-elf-g++.
2019-02-22 10:45:32 +01:00
Andreas Kling
0aaec6b19a
Support resizing the Terminal app.
...
I set it up so that TIOCSWINSZ on a master PTY gets forwarded to the slave.
This feels intuitively right. Terminal can then use that to inform the shell
or whoever is inside the slave that the window size has changed.
TIOCSWINSZ also triggers the generation of a SIGWINCH signal. :^)
2019-02-20 23:38:20 +01:00
Andreas Kling
cbfd416279
LibC: The standard C library needs to be able to build as pure C.
...
Looks like we can't use those comfy C++ attributes in this code then.
2019-02-15 22:37:20 +01:00
Andreas Kling
022f7790db
Use modern C++ attributes instead of __attribute__ voodoo.
...
This is quite nice, although I wish [[gnu::always_inline]] implied inline.
Also "gnu::" is kind of a wart, but whatcha gonna do.
2019-02-15 12:30:48 +01:00
Andreas Kling
a63e8839da
LibC: Add socket(), bind(), listen(), accept() and connect().
2019-02-14 15:26:06 +01:00
Andreas Kling
2f35e54f80
Kernel: Begin implementing UNIX domain sockets.
2019-02-14 14:17:38 +01:00
Andreas Kling
736e852525
LibC: Implement enough missing stuff to get bash-5.0 running. :^)
2019-02-08 02:38:21 +01:00
Andreas Kling
dddd0e7b03
Get nyancat nyanning in Serenity.
...
I found a cute program that renders an animated nyancat in the terminal.
This patch adds enough hackery to get it working correctly. :^)
2019-02-03 16:11:28 +01:00
Andreas Kling
5e9ba2ac84
Kernel: Rewrite ProcFS.
...
Now the filesystem is generated on-the-fly instead of manually adding and
removing inodes as processes spawn and die.
The code is convoluted and bloated as I wrote it while sleepless. However,
it's still vastly better than the old ProcFS, so I'm committing it.
I also added /proc/PID/fd/N symlinks for each of a process's open fd's.
2019-02-03 12:33:11 +01:00
Andreas Kling
c4fce9b3f9
Make stat() work on device files again.
...
FileDescriptor will now keep a pointer to the original inode even after
opening it resolves to a character device.
Fixed up /bin/ls to display major and minor device numbers instead of size
for device files.
2019-01-31 05:05:57 +01:00
Andreas Kling
c30e2c8d44
Implement basic chmod() syscall and /bin/chmod helper.
...
Only raw octal modes are supported right now.
This patch also changes mode_t from 32-bit to 16-bit to match the on-disk
type used by Ext2FS.
I also ran into EPERM being errno=0 which was confusing, so I inserted an
ESUCCESS in its place.
2019-01-29 04:55:08 +01:00
Andreas Kling
8bb18fdc56
Kernel: Get rid of Unix namespace.
...
This is no longer needed as the Kernel can stand on its own legs now
and there won't be any conflict with host system data types.
2019-01-23 06:57:00 +01:00
Andreas Kling
5605295d00
Oops, forgot to add the select() files to LibC a while ago.
2019-01-17 01:41:13 +01:00
Andreas Kling
49b63281a0
Make it possible for a process to switch controlling terminals.
...
Via the TIOCSCTTY and TIOCNOTTY ioctls.
2019-01-15 08:49:24 +01:00
Andreas Kling
ac7a60225e
Add TIOCGWINSZ ioctl so userland can determine terminal geometry.
...
(Don't) use this to implement short-form output in ls.
I'm too tired to make a nice column formatting algorithm.
I just wanted something concise when I type "ls".
2018-11-29 03:45:23 +01:00
Andreas Kling
de4604ac95
Finally hook up the mkdir code to a syscall.
...
Added a /bin/mkdir that makes directories. How very neat :^)
There are various limitations because of missing functionality.
2018-11-18 15:02:16 +01:00
Andreas Kling
303577df16
Various stubs while trying to get an old coreutils to build.
2018-11-17 15:56:09 +01:00
Andreas Kling
9d05f6b7a7
Make bash-2.05b build with minimal changes.
...
This is really neat. :^)
2018-11-17 00:14:07 +01:00
Andreas Kling
084287ca45
Reimplement tcsetattr/tcgetattr as ioctls.
2018-11-16 15:41:48 +01:00
Andreas Kling
c99f8af66d
Add ioctl() and reimplement tcsetpgrp/tcsetpgrp as ioctls.
2018-11-16 13:13:50 +01:00
Andreas Kling
6a0a2c9ab4
Some improvements to signals.
...
- Add sigprocmask() and sigpending().
- Forked children inherit signal dispositions and masks.
- Exec clears signal dispositions and masks.
2018-11-10 23:30:41 +01:00
Andreas Kling
4914f3b837
Build LibC and Userland with clang as well.
2018-11-09 14:29:00 +01:00