Commit graph

1156 commits

Author SHA1 Message Date
Gavin Hayes
a80eea78fe Squashed commit of the following:
commit d9e0429dec42bf786aa73a66c259c275be5a8de9
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:59 2022 -0400

    Revert "Don't relocate file descriptor memory"

    This reverts commit 3265324e00.

commit 22ce7f16eeb326408208fabee57eace63371352c
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:58 2022 -0400

    Revert "Make some minor touchups for nightlies"

    This reverts commit e9272f03fb.

commit 8ef0057111e955fa18f2cce77b36046fa96fdcd5
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:57 2022 -0400

    Revert "Tidy up the threading implementation"

    This reverts commit 155b378a39.

commit 7e99e6e08b14003df21d42bedf473219417d3610
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:56 2022 -0400

    Revert "Bare metal VGA: minor improvements (#608)"

    This reverts commit bae7367774.

commit cd184ff7fe4f8539a3928e8f2b8703e699c199e4
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:55 2022 -0400

    Revert "Rewrite recursive mutex code"

    This reverts commit cfcf5918bc.

commit 4aa26c44ee200ffbcb591b3145876095fa235bd3
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:54 2022 -0400

    Revert "Clean up the TLS code"

    This reverts commit 333768440c.

commit f8c989127c7b8821e2183858c321fcd54fc45ffe
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:52 2022 -0400

    Revert "Remove stdio lock macros from amalgamation"

    This reverts commit cdb2284f0d.

commit d10cd5c40f576a2dde8448338d2e9b3d88e160f8
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:50 2022 -0400

    Revert "Import nsync"

    This reverts commit 5dff63a31c.

commit 2a49d50c29f518367e0a51cb7a0a2b4b0a1679f0
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:49 2022 -0400

    Revert "Fix the build"

    This reverts commit 3de35e196c.

commit c258d09ee5a7f48cd3d0d71667aba6fa7ab0e9ee
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:49 2022 -0400

    Revert "Use *NSYNC for POSIX threads locking APIs"

    This reverts commit b5cb71ab84.

commit 43bf84f09737bf87d79c7650dde52e030556056d
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:48 2022 -0400

    Revert "Add *NSYNC mu_test"

    This reverts commit 9b89a7c51d.

commit 94a0e96d666f7cf2dd4af03b42516956908f4ad7
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:47 2022 -0400

    Revert "Don't pushpop in long mode without stack (#611)"

    This reverts commit 569c031934.

commit 55f9f15c8659f6956ac4c9e0334b7884f5ff1c01
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:46 2022 -0400

    Revert "Update redbean doc to correct return values (#610)"

    This reverts commit 55ddf73484.

commit 30865675f4c750d1fec64df9b7bf98e6132787a9
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:45 2022 -0400

    Revert "Left-align stub arguments to dd (fixes #374) (#598)"

    This reverts commit 0305194d98.

commit 01e8de146f8de3abb1fe8cf2c6e7054a68be411e
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:43 2022 -0400

    Revert "Add Vista branch to GitHub workflows"

    This reverts commit c03359c637.

commit 66966f8ae2d020e7c3e8f1ed20eddd9b155f9ac4
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:43 2022 -0400

    Revert "[WIP] Get bare metal working outside of an emulator (#609)"

    This reverts commit 116bda997e.

commit 9ab0952c35086ac6c3c1dc186ae9ff1f90d8d76c
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:41 2022 -0400

    Revert "Bare metal VGA: implement "status report" escape codes (#613)"

    This reverts commit c4eb701d56.

commit 86f6a61d16e2c896939f536119ba328c7220f1eb
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:38 2022 -0400

    Revert "Fix the build"

    This reverts commit 790c661317.

commit 92b09acf939fdd3c10a81d5dd212f76351f05451
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:37 2022 -0400

    Revert "Fix bug with sendfile() on XNU"

    This reverts commit 827f25f054.

commit 3a5b536995cf8c48fffd371097aae9dfbeeebb44
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:36 2022 -0400

    Revert "Fix preadv() and pwritev()"

    This reverts commit 050062bcbb.

commit 854ec3631f54d087797a67c8e86b7d2655bc1317
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:35 2022 -0400

    Revert "Fix POSIX advisory locks on Windows"

    This reverts commit a5fa90a21f.

commit 5cc1a788126b5b2b54656e0f4244a56596b59978
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:35 2022 -0400

    Revert "Fix F_DUPFD_CLOEXEC on some systems"

    This reverts commit c64e7eaf7c.

commit 0264d3b34dcf80b0d34d6f4ef100a0f8545047e0
Author: Gavin Hayes <gavin@computoid.com>
Date:   Wed Sep 21 22:41:33 2022 -0400

    Revert "Add README description for new vista branch"

    This reverts commit 30140812f0.
2022-09-21 22:43:07 -04:00
Justine Tunney
30140812f0
Add README description for new vista branch 2022-09-15 12:51:24 -07:00
Justine Tunney
c64e7eaf7c
Fix F_DUPFD_CLOEXEC on some systems 2022-09-15 12:48:26 -07:00
Justine Tunney
a5fa90a21f
Fix POSIX advisory locks on Windows 2022-09-15 12:44:00 -07:00
Justine Tunney
050062bcbb
Fix preadv() and pwritev() 2022-09-15 12:30:36 -07:00
Justine Tunney
827f25f054
Fix bug with sendfile() on XNU 2022-09-15 12:27:30 -07:00
Justine Tunney
790c661317
Fix the build 2022-09-15 12:02:44 -07:00
tkchia
c4eb701d56
Bare metal VGA: implement "status report" escape codes (#613)
* Bare metal VGA: implement "status report" escape codes
* Minor fix to pseudoteletypewriter code

Co-authored-by: tkchia <tkchia-cosmo@gmx.com>
2022-09-15 12:02:35 -07:00
tkchia
116bda997e
[WIP] Get bare metal working outside of an emulator (#609)
You can now run bare metal on bare metal!

* Fix handling of int 0x15 eax = 0xe820 memory map
* Fix some issues in initial page table creation
* hello4.com now works outside emulators
* Ensure area for identity page tables are zeroed first
* Simplify logic for creating page table entries, this partly
  reverts 577c0f6226
* Add degenerate MBR partition entry, to ease testing

Co-authored-by: tkchia <tkchia-cosmo@gmx.com>
2022-09-15 12:02:28 -07:00
Justine Tunney
c03359c637
Add Vista branch to GitHub workflows 2022-09-15 12:01:16 -07:00
Connor
0305194d98
Left-align stub arguments to dd (fixes #374) (#598)
This satisfies busybox's non-standard integer
argument parsing, and even saves a few bytes.
2022-09-12 04:26:38 -07:00
Paul Kulchenko
55ddf73484
Update redbean doc to correct return values (#610) 2022-09-11 19:51:18 -07:00
tkchia
569c031934
Don't pushpop in long mode without stack (#611) 2022-09-11 19:50:32 -07:00
Justine Tunney
9b89a7c51d
Add *NSYNC mu_test 2022-09-11 18:56:29 -07:00
Justine Tunney
b5cb71ab84
Use *NSYNC for POSIX threads locking APIs
Condition variables, barriers, and r/w locks now work very well.
2022-09-11 11:04:50 -07:00
Justine Tunney
3de35e196c
Fix the build 2022-09-10 19:57:50 -07:00
Justine Tunney
5dff63a31c
Import nsync 2022-09-10 16:12:31 -07:00
Justine Tunney
cdb2284f0d
Remove stdio lock macros from amalgamation 2022-09-10 12:03:36 -07:00
Justine Tunney
333768440c
Clean up the TLS code 2022-09-10 11:49:13 -07:00
Justine Tunney
cfcf5918bc
Rewrite recursive mutex code 2022-09-10 09:18:52 -07:00
tkchia
bae7367774
Bare metal VGA: minor improvements (#608) 2022-09-10 04:28:28 -07:00
Justine Tunney
155b378a39
Tidy up the threading implementation
The organization of the source files is now much more rational.
Old experiments that didn't work out are now deleted. Naming of
things like files is now more intuitive.
2022-09-10 02:56:25 -07:00
Justine Tunney
e9272f03fb
Make some minor touchups for nightlies 2022-09-09 19:12:40 -07:00
Justine Tunney
3265324e00
Don't relocate file descriptor memory
This change fixes #496 where ASAN spotted a race condition that could
happen in multithreaded programs, with more than OPEN_MAX descriptors
when using ZipOS or Windows NT, which require tracking open file info
and this change fixes that table so it never relocates, thus allowing
us to continue to enjoy the benefits of avoiding locks while reading.
2022-09-09 16:54:28 -07:00
Justine Tunney
c3208eb9d5
Add more POSIX threads APIs 2022-09-09 11:30:33 -07:00
Justine Tunney
1729a8259c
Introduce MODE=fastbuild for 28% speedup 2022-09-09 08:59:59 -07:00
Gautham
094ccbb4bd
Add more foo64 stubs for Rust (#607) 2022-09-09 06:50:45 -07:00
Justine Tunney
e97f1a99cf
Fix pthread stacks with larger guard size 2022-09-09 06:41:22 -07:00
tkchia
1db76c288e
Bare metal VGA: enable bright background colors, disable blinking (#603)
Co-authored-by: tkchia <tkchia-cosmo@gmx.com>
2022-09-09 04:35:16 -07:00
Paul Kulchenko
f68151c010
Add sigpending to redbean unix.* module (#605) 2022-09-09 04:20:13 -07:00
Justine Tunney
2d17ab016c
Perform more low-level code cleanup 2022-09-09 04:07:08 -07:00
Gautham
c32e2d4486
Set stackaddr if mmap is called in pthread_create (#606) 2022-09-08 21:07:53 -07:00
Paul Kulchenko
5140897c27
Update redbean to include params in slash redirect (#604) 2022-09-08 19:14:54 -07:00
Justine Tunney
9f963dc597
Clean up some of the threading code 2022-09-08 12:31:56 -07:00
Justine Tunney
0547eabcd6
Polyfill IPv6 on non-Linux 2022-09-08 06:06:22 -07:00
Justine Tunney
b73e35c6fa
Improve open source compatibility
This change tunes the default stack size for the outside world to 8mb
while at the same time, reducing Cosmopolitan's default stack size to
64kb. You can override the stack size using STATIC_STACK_SIZE(). Your
build scripts should point to o//ape/public/ape.lds

This change also fixes the definition of SOMAXCONN and removes AF_RDS
since it's not polyfilled and Python 3.11 complained.
2022-09-08 03:19:35 -07:00
Justine Tunney
0e2b1bfeed
Make garbage collection thread safe
- You can now use _gc(malloc()) in multithreaded programs
- This change fixes a bug where fork() on NT disabled TLS
- Fixed TLS code morphing on XNU/NT, for R8-R15 registers
2022-09-08 02:33:01 -07:00
Justine Tunney
571c2c3c69
Fix race condition in makedirs() 2022-09-07 23:12:44 -07:00
Gavin Hayes
b7c07d548c
Add FP_ILOGB constants (#599) 2022-09-07 21:37:53 -07:00
Justine Tunney
6c323383e5
Make some fixups to POSIX threads 2022-09-07 21:13:50 -07:00
Justine Tunney
de511bc71a
Add phtread_setname_np() and pthread_getname_np() 2022-09-07 19:04:05 -07:00
Justine Tunney
114176c304
Add more foo64() functions for Rust 2022-09-07 05:48:57 -07:00
Gavin Hayes
a849a63771
Implement sigpending for sysv and nt (#597) 2022-09-07 05:38:12 -07:00
Justine Tunney
4339d9f15e
Add pthread attributes and other libc functions 2022-09-07 05:28:32 -07:00
Justine Tunney
d5c9308a43
Don't sandbox documentation generator 2022-09-06 20:45:21 -07:00
Justine Tunney
8bd9ad8342
Simplify redbean serialization code 2022-09-06 20:07:29 -07:00
tkchia
3fdb1c14f1
Add VGA support on bare metal (#588)
If your main module has this declaration:

    STATIC_YOINK("vga_console");

Then a VGA driver will be linked into your executable which
displays your stdio characters on the PC display, whereas
before we could only use the serial port. Your display is an
ANSI terminal and it's still a work in progress.
2022-09-06 18:41:08 -07:00
Gavin Hayes
598640864a
Fix inability to add some signals to mask on NT (#596) 2022-09-06 18:35:26 -07:00
Justine Tunney
d861d2787b
Import OpenBSD sorting algorithms
OpenBSD's qsort() function is more secure than the ones used by
FreeBSD, NetBSD and MacOS. The best part is it goes faster too!
This change also imports the OpenBSD mergesort() and heapsort()
2022-09-06 17:52:26 -07:00
Justine Tunney
dbf12c30b0
Make more compatibility improvements 2022-09-06 12:36:34 -07:00