Skip to content

Instantly share code, notes, and snippets.

View pandax381's full-sized avatar

YAMAMOTO Masaya pandax381

View GitHub Profile
@pandax381
pandax381 / Jool-3.4.0.patch
Last active November 13, 2015 03:41
Unofficial patch for Jool-3.4.0 for kernel 4.1 or later.
diff -ur Jool-3.4.0.orig/mod/common/core.c Jool-3.4.0/mod/common/core.c
--- Jool-3.4.0.orig/mod/common/core.c 2015-11-05 07:35:11.000000000 +0900
+++ Jool-3.4.0/mod/common/core.c 2015-11-11 17:54:38.888931547 +0900
@@ -67,7 +67,7 @@
static bool check_namespace(const struct net_device *dev)
{
#ifdef CONFIG_NET_NS
- if (dev && dev->nd_net != joolns_get())
+ if (dev && dev->nd_net.net != joolns_get())
return false;
Uncompressing Linux... done, booting the kernel.
[ 0.000000] Booting Linux on physical CPU 0xf00
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.1.19-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #858 SMP Tue Mar 15 15:56:00 GMT 2016
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: Raspberry Pi 2 Model B Rev 1.1
[ 0.000000] cma: Reserved 8 MiB at 0x3a400000
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#define BLOCKSIZ 512
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <limits.h>
#include <nss.h>
#include <sys/types.h>
#include <netdb.h>
#include <errno.h>
#include <string.h>
#include <assert.h>
#include <unistd.h>
#include <net/if.h>
#include <stdlib.h>
@pandax381
pandax381 / main.go
Last active November 16, 2016 08:03
libnss-dummy-go
package main
/*
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
@pandax381
pandax381 / boot.log
Created December 6, 2016 09:03
orangepi one boot log with self build u-boot and busybox
U-Boot SPL 2016.11 (Dec 06 2016 - 07:54:39)
DRAM: 512 MiB
Trying to boot from MMC1
U-Boot 2016.11 (Dec 06 2016 - 07:54:39 +0000) Allwinner Technology
CPU: Allwinner H3 (SUN8I 1680)
Model: Xunlong Orange Pi One
DRAM: 512 MiB
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
@pandax381
pandax381 / float_test.c
Created August 17, 2017 02:48
simple float test
#include <stdio.h>
#include <stdint.h>
int
main (void) {
float a = 1.0;
float b = 2.0;
float c = a + b;
fprintf(stderr, "sizeof(float): %d\n", sizeof(float));
@pandax381
pandax381 / softfloat_test.c
Last active August 17, 2017 02:58
Berkeley SoftFloat test
#include <stdio.h>
#include "softfloat.h"
int
main (void) {
float32_t a = ui32_to_f32(0x3F800000); /* 1.0 */
float32_t b = ui32_to_f32(0x40000000); /* 2.0 */
float32_t c = f32_add(a, b);
fprintf(stderr, "0x%lx + 0x%lx = 0x%lx\n",