Skip to content

Instantly share code, notes, and snippets.

View naoki9911's full-sized avatar
🌴
On vacation

Naoki MATSUMOTO naoki9911

🌴
On vacation
View GitHub Profile
# Thanks to https://github.com/skjune12/srv6-playground
#!/bin/bash
if [[ $(id -u) -ne 0 ]] ; then
echo "Please run with sudo"
exit 1
fi
run () {
echo "$@"

Keybase proof

I hereby claim:

  • I am naoki9911 on github.
  • I am pibvt (https://keybase.io/pibvt) on keybase.
  • I have a public key ASAjGCD2FE4z8nRbE80IMEc8wQzg7Ejyr3LInuaV-Hui1Qo

To claim this, I am signing this object:

@naoki9911
naoki9911 / main.go
Created November 1, 2019 12:02
SoftEther Wrapper
package main
import (
"flag"
"fmt"
"log"
"os"
"os/exec"
"strings"
"net"
@naoki9911
naoki9911 / mp_uefi.h
Last active September 17, 2018 04:22
struct uefi_madt {
uchar sig[4];
uint len;
uchar rev;
uchar chksum;
uchar oem_id[6];
uchar oem_table[8];
uint oem_rev;
uint creator_id;
uint creator_rev;
@naoki9911
naoki9911 / mp_uefi.c
Last active September 17, 2018 04:31
#include "types.h"
#include "defs.h"
#include "param.h"
#include "memlayout.h"
#include "x86.h"
#include "mmu.h"
#include "proc.h"
#include "mp_uefi.h"
#include "debug.h"
@naoki9911
naoki9911 / structs.h
Last active September 17, 2018 04:02
struct rsdp {
CHAR8 sig[8];
UINT8 Checksum;
CHAR8 OEMID[6];
UINT8 Revision;
UINT32 RsdtAddress;
UINT32 Len;
UINT64 XsdtAddress;
UINT8 ExtChecksum;
UINT8 reserved[3];
VOID *vendor_table;
Status = EfiGetSystemConfigurationTable(&gEfiAcpiTableGuid,&vendor_table);
struct rsdp *acpi_rsdp = (struct rsdp *)vendor_table;
Print(L"Signature:");
UINTN i;
for(i=0;i<6;i++){
Print(L"%c",acpi_rsdp->sig[i]);
}
Print(L"\n");
Print(L"XSDT Address: %08x\n",acpi_rsdp->XsdtAddress);
@naoki9911
naoki9911 / mp.c
Created September 16, 2018 15:32
void
mpinit(void)
{
uchar *p, *e;
int ismp;
struct mp *mp;
struct mpconf *conf;
struct mpproc *proc;
struct mpioapic *ioapic;
int
main(void)
{
kinit1(end, P2V(4*1024*1024)); // phys page allocator
kvmalloc(); // kernel page table
mpinit(); // detect other processors
lapicinit(); // interrupt controller
seginit(); // segment descriptors
picinit(); // disable pic
ioapicinit(); // another interrupt controller
@naoki9911
naoki9911 / entry.S
Last active September 15, 2018 15:46
//一部省略
.globl _start
_start = V2P_WO(entry)
.globl wait_main
wait_main:
.long 0
# Entering xv6 on boot processor, with paging off.
.globl entry
entry: