Skip to content

Instantly share code, notes, and snippets.

View aycanirican's full-sized avatar
💭
Lifelong learning

Aycan iRiCAN aycanirican

💭
Lifelong learning
View GitHub Profile
@aycanirican
aycanirican / gist:c967f2672254480a99be69982064872d
Created October 7, 2026 08:21
virtio-rng: no hardware entropy on arm64, until now...
## Transferring control to Plan 9 (at address 40100000) ...
127 holes free
0x40525000 0x49d34000 159444992
159444992 bytes free
Plan 9
timer frequency 24000000 Hz
cpu0: 1000MHz QEMU
511M memory: 157M kernel data, 354M user, 1875M swap
virtio-rng: 4096 bytes of host entropy
@aycanirican
aycanirican / gist:451791a0de781b2a92aeec3ad24665ae
Created October 7, 2026 07:12
arm64/gic: support multiple cpus on qemu virt-11.1 (uses apple's hardware vGIC by default) hvf
term% cat /tmp/gic.patch
From: Aycan Irican <iricanaycan@gmail.com>
Date: Wed, 07 Oct 2026 06:23:22 +0000
Subject: [PATCH] arm64/gic: read GICR_TYPER with single 64-bit access
---
diff dd17bf052103981af9afc3ab7a35a0a9661de168 2ab37416abba5af8eb25725eea107f7e35da71ec
--- a/sys/src/9/arm64/gic.c
+++ b/sys/src/9/arm64/gic.c
@@ -97,11 +97,13 @@
@aycanirican
aycanirican / gist:ecfab33d8b95436f53b9653cabd695bc
Created October 7, 2026 06:34
plan9: start 9front arm64 on apple silicon using QEMU hvf
# Copy 9qemu.u manually to the boot partition since installation skips that step.
# Use `accel=hvf,kernel-irqchip=off` for more than one cpu if you're on virt-11.1.
nix run nixpkgs#qemu -- \
-name 9front-cpu22 \
-M virt-11.1,gic-version=3,highmem-ecam=off,accel=hvf \
-cpu host \
-m 1G \
-smp 1 \
-bios "$HOME/debian-prebuilt-uboot/u-boot.bin" \
-device virtio-blk-pci-non-transitional,drive=disk \

Keybase proof

I hereby claim:

  • I am aycanirican on github.
  • I am aycan (https://keybase.io/aycan) on keybase.
  • I have a public key ASCetXizucbRp_ibah6txD_zV0Dse1iLP1x5VYc_VhjQrwo

To claim this, I am signing this object:

// password based key derivation function 1 with SHA256 (PBKDF1SHA256) in golang
// strength 2^17
func PBKDF1SHA256(pass []byte, salt []byte) []byte {
h := sha256.Sum256(append(pass, salt...)) // first_hash
for i := 0; i <= 1<<17; i++ {
h = sha256.Sum256(h[:])
}
return h[:]
}
@aycanirican
aycanirican / Main.hs
Created December 9, 2016 06:18 — forked from abakst/Main.hs
module Main where
import Control.Distributed.Process hiding (call)
import Control.Distributed.Process.Node as Node (initRemoteTable, runProcess)
import Control.Distributed.Process.Extras (resolve, __remoteTable)
import Control.Distributed.Process.Backend.SimpleLocalnet
import Control.Concurrent (threadDelay)
import Control.Monad
import Network.Transport hiding (send)
import System.Environment
### Keybase proof
I hereby claim:
* I am aycanirican on github.
* I am iricanaycan (https://keybase.io/iricanaycan) on keybase.
* I have a public key whose fingerprint is 308E 2721 5E27 3213 975E E92D 2592 7083 2D00 2BBF
To claim this, I am signing this object:
@aycanirican
aycanirican / UDPEchoServer.hs
Created October 21, 2014 05:55
haskell udp example found in the wild
--
-- UDPEchoServer.hs: Exactly what the name says, a datagram echo server.
--
module Main (main) where
import Network.Socket
import System.Posix.Directory
import System.Posix.Files
@aycanirican
aycanirican / gist:2031542
Created March 13, 2012 21:00
19k request/sec on dragonflybsd.
% # source: https://github.com/aycanirican/hlibev/blob/master/Examples/ByteStringConcurrent.hs
% dmesg | grep GHz
CPU: Pentium(R) Dual-Core CPU E6300 @ 2.80GHz (2799.48-MHz K8-class CPU)
% curl http://192.168.1.100:5002/
Hello, World!
% uname -a
DragonFly x 3.1-DEVELOPMENT DragonFly v3.1.0.299.g62f17-DEVELOPMENT #13: Mon Mar 12 12:39:42 EET 2012 root@x:/usr/obj/usr/src/sys/MYKERNEL x86_64
@aycanirican
aycanirican / gist:2023676
Created March 12, 2012 18:03
dragonflybsd haskell libev binding Hello World.
% ab -n 10000 -c 10 http://127.0.0.1:8080/
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.121.2.12 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests