Hacker Newsnew | past | comments | ask | show | jobs | submit | khrbtxyz's commentslogin

https://github.com/mariuz/linux-0.01 might give you some ideas.



Another bit of trivia about the shebang support in Linux is that is possible to build the kernel without it. https://github.com/torvalds/linux/blob/master/fs/Kconfig.bin...

  config BINFMT_SCRIPT
  tristate "Kernel support for scripts starting with #!"
  default y
  help
    Say Y here if you want to execute interpreted scripts starting with
    #! followed by the path to an interpreter.


I don't quite understand what --exec does. If I leave out --exec from example 3, is it supposed to prevent bash from executing other programs?

  $ landrun --log-level debug --ro /usr/bin,/lib,/lib64 /usr/bin/bash --norc
  [landrun] 2025/03/22 17:16:29 Sandbox config: {ReadOnlyPaths:[/usr/bin /lib /lib64] ReadWritePaths:[] AllowExec:false BindTCPPorts:[] ConnectTCPPorts:[] BestEffort:true}
  [landrun:debug] 2025/03/22 17:16:29 Adding read-only path: /usr/bin
  [landrun:debug] 2025/03/22 17:16:29 Adding read-only path: /lib
  [landrun:debug] 2025/03/22 17:16:29 Adding read-only path: /lib64
  [landrun:debug] 2025/03/22 17:16:29 Applying Landlock restrictions
  [landrun] 2025/03/22 17:16:29 Landlock restrictions applied successfully
  [landrun] 2025/03/22 17:16:29 Executing: [/usr/bin/bash --norc]
  bash-5.2$ 
  bash-5.2$ /usr/bin/uname -r
  6.13.7-200.fc41.aarch64


yeah it wasn't the best call, have a look at v0.1.4, I think it's better now!


Large projects like the Linux kernel, which are mostly C, use the preprocessor in .S files quite heavily.

Linux has hardly any .s files.

  ~/linux$ find . -name '*.s'
  ./arch/x86/kernel/asm-offsets.s
  ./kernel/bounds.s
  ./scripts/mod/devicetable-offsets.s
But there are plenty of .S files with #includes

  ~/linux$ $ find . -name '*.S' | xargs grep -l '#include' | wc -l
  1217
Edit: simplify command as suggested


FYI, `grep -l` will print just the matching filenames, no need for the sed/sort -u. `git grep` and `rg` also support this option. (I say this because I also used to overcomplicate this in my typical usage.)


Function typedefs make this less confusing by removing awkward parentheses. e.g.

  typedef int read_block_fn(void *context, u8 *buf, unsigned int block, size_t len);
https://github.com/torvalds/linux/blob/0a9b9d17f3a781dea03ba...


Nested virtualization needs at least an M3

https://developer.apple.com/documentation/virtualization/vzg...

This is the sad situation on my M2 MacBook Pro :(

  $ swift repl
  Welcome to Apple Swift version 6.0.2 (swiftlang-6.0.2.1.2 clang-1600.0.26.4).
  Type :help for assistance.
    1> import Virtualization
    2> VZGenericPlatformConfiguration.isNestedVirtualizationSupported
  $R0: Bool = false


This is form-over-function, classic Apple. They don't want to give even the slightest impression that they are selling a wired mouse.


From a Raspberry Pi 5: L2 cache line is 128

  Vendor ID:              ARM
  Model name:             Cortex-A76

  $ lscpu -C
  NAME ONE-SIZE ALL-SIZE WAYS TYPE        LEVEL SETS PHY-LINE COHERENCY-SIZE
  L1d       64K     256K    4 Data            1  256                      64
  L1i       64K     256K    4 Instruction     1  256                      64
  L2       512K       2M    4 Unified         2 1024                     128
  L3         2M       2M   16 Unified         3 2048                      64


There's a Python library that has been quite reliable for me for local control.

  $ python3
  Python 3.12.4 (main, Jun  6 2024, 18:26:44) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import pywemo
  >>> d = pywemo.discover_devices()
  >>> d
  [<WeMo Switch "Guest">, <WeMo Switch "Fireplace">, <WeMo Switch "Bedroom Dresser">]
  >>> d[0].model
  'Belkin Plugin Socket 1.0'
  >>> d[0].toggle()
  >>>


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: