修正BSDライセンスでかなり良い感じのTCP/IPプロトコルスタック。 MinixもVirtualBoxも使っている様子。主な実装済みプロトコルは以下の通り。
- DNS, DHCP
- TCP, UDP
- IPv4, IPv6, ICMP
- ARP
Pmu = 0x504d55, | |
// PMU function IDs. | |
pub const SBI_PMU_NUM_COUNTERS: usize = 0x00; | |
pub const SBI_PMU_COUNTER_CONFIG_MATCHING: usize = 0x02; | |
pub const SBI_PMU_COUNTER_START: usize = 0x03; | |
pub const SBI_PMU_COUNTER_STOP: usize = 0x04; | |
pub const SBI_PMU_COUNTER_FW_READ: usize = 0x05; | |
pub const SBI_PMU_COUNTER_FW_READ_HI: usize = 0x06; |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define _assert_fail(msg, ...) do { puts(msg); exit(1); } while (0) | |
#define CONST __attribute__((__const__)) | |
#define seL4_Null ((void*)0) | |
#define LIBSEL4_INLINE_FUNC static inline | |
typedef uint32_t seL4_CPtr; | |
typedef uint32_t seL4_Word; |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>esptool.js</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/xterm/2.9.2/xterm.min.js" integrity="sha256-8rsVcpCnO6HdeJL84i0VdubjM42fjSmO8aONghdq3gc=" crossorigin="anonymous"></script> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/xterm/2.9.2/xterm.min.css" integrity="sha256-w69o8Y6P5VZjfYFmn2KlqMU7TUi2I+oWObi8FLlVZZg=" crossorigin="anonymous" /> | |
</head> |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define _assert_fail(msg, ...) do { puts(msg); exit(1); } while (0) | |
#define CONST __attribute__((__const__)) | |
#define seL4_Null ((void*)0) | |
#define LIBSEL4_INLINE_FUNC static inline | |
typedef uint32_t seL4_CPtr; | |
typedef uint32_t seL4_Word; |
#[test] | |
fn grapheme_iter() { | |
let text = "a👩🔬"; | |
let mut c = unicode_segmentation::GraphemeCursor::new(text.len(), text.len(), true); | |
dbg!(text.len()); | |
dbg!(text.char_indices().map(|(i, c)| (i, c)).collect::<Vec<_>>()); | |
assert_eq!( | |
c.prev_boundary(&text[(text.len() - 4)..], text.len() - 4), | |
Err(GraphemeIncomplete::PrevChunk) |
Booting Resea v0.9.0 (dc57ce1)... | |
[kernel] Booted CPU #0 | |
[vm] ready | |
[benchmark_server] starting benchmark server... | |
[benchmark] starting IPC benchmark... | |
{"type":"metric","key":"reading cycle counter","value":30} | |
[benchmark] reading cycle counter: cycles: avg=31, min=30, max=376 | |
[benchmark] reading cycle counter: l1d_cache_access: avg=0, min=0, max=0 | |
[benchmark] reading cycle counter: l2d_cache_access: avg=0, min=0, max=0 | |
[benchmark] reading cycle counter: mem_access: avg=10, min=10, max=174 |
FROM ubuntu:latest | |
RUN apt update -y && apt install -y musl-tools | |
ADD hello.c /hello.c | |
RUN musl-gcc -static hello.c -o /hello | |
RUN mkdir /empty_dir | |
FROM scratch | |
WORKDIR / | |
COPY --from=0 /hello /hello | |
COPY --from=0 /empty_dir /tmp |
use core::{marker::PhantomData, ptr::NonNull}; | |
use memoffset::offset_of; | |
/// An intrusive doubly-linked list node. | |
pub struct ListNode<T> { | |
/// The previous node. It points to itself if the list has only sigle entry. | |
prev: NonNull<ListNode<T>>, | |
/// The next node. It points to itself if the list has only sigle entry. | |
next: NonNull<ListNode<T>>, | |
_pd: PhantomData<T>, |
use std::cmp::min; | |
use std::ops; | |
use std::slice; | |
pub trait Interval: Ord + Clone { | |
fn is_empty(&self) -> bool; | |
fn includes(&self, other: &Self) -> bool; | |
fn overlaps_with(&self, other: &Self) -> bool; | |
/// ```text | |
/// self: ...xxxx.... |