Skip to content

Instantly share code, notes, and snippets.

🍪
Focusing

Ben Mezger (seds) benmezger

🍪
Focusing
Block or report user

Report or block benmezger

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View crt0.S
/* Move section to .init that is allocatable and executable. */
.section .init, "ax"
.align 2
.global _start
_start:
.cfi_startproc
.cfi_undefined ra
# _setup_mtrap if interrupt is not enabled
View gist:060cef897e3329606cba8339f971c033
$ make CC=/Users/benmezger/Downloads/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-apple-darwin/bin/riscv64-unknown-elf-gcc DEBUG=1
rm -r -f kernel
riscv64-unknown-elf-gcc -march=rv64imafdc -mcmodel=medany -mabi=lp64d -DRISCV_ARCH -O0 -lgcc -I./include/ -g -DDEBUG -Wl,--gc-sections -nostartfiles -nodefaultlibs -Wl,-T,riscv64-virt.ld src/init.c src/string.c src/ftd.c src/kmain.c src/arch/riscv/cpu.c src/arch/riscv/entry.S src/arch/riscv/trap.c src/arch/riscv/crt0.S -o kernel
/Users/benmezger/Downloads/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-apple-darwin/bin/../lib/gcc/riscv64-unknown-elf/8.3.0/../../../../riscv64-unknown-elf/bin/ld: /var/folders/cm/0ds487q92074nx51t2sdt2lr0000gp/T//ccsL9Mg2.o: in function `_scan_fdt':
/Users/benmezger/workspace/new-kernel/src/ftd.c:29: undefined reference to `__bswapsi2'
/Users/benmezger/Downloads/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-apple-darwin/bin/../lib/gcc/riscv64-unknown-elf/8.3.0/../../../../riscv64-unknown-elf/bin/ld: /var/folders/cm/0ds487q92074nx51
View crt0.S
/* Move section to .init that is allocatable and executable. */
.section .init, "ax"
.align 2
.global _start
_start:
.cfi_startproc
.cfi_undefined ra
.option push
View go-build-error
$ go build ./internal/bands
internal/bands/bands.go:5:2: module github.com/go-chi/chi@latest found (v4.0.2+incompatible), but does not contain package github.com/go-chi/chi/render
internal/bands/bands.go:6:2: malformed module path "internal/io": missing dot in first path element
View gist:c555a14661e77d506bdeb37b0d6bdd04
workspace/bands/src ∙ go build cmd/main.go 130 ↵
cmd/main.go:6:2: cannot find package "internal/bands" in any of:
/usr/local/opt/go/libexec/src/internal/bands (from $GOROOT)
/Users/benmezger/workspace/go/src/internal/bands (from $GOPATH)
View gist:cdd1649beee434e978703a82921b341b
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAADwCAYAAABxLb1rAAAgAElEQVR4Xuy9CbRld3Xe+Z073/deDSqpJEACmVlinsGAsQHH2OAhjp20HePGYCe9nJVe3e6kM7ozOk6cYSVObGIbuz00scFTIMYmYEYhkI3DLIzmoaSa6813Pufe0+v37f//1aVikISloiTqscR79d4dzj3nf77/3t/+9reLxXi9XtRN1Y2mGiqkeq5Gq8k3qZqr6La1mM+kZlONRiEVc9WF/LiibkpFSyqaUr1I3/ljFb9XLakh1Q3x0vHFD7x4/nv+ff7b8r8v/nzhnoGFJP5rpEP0gomf6zIu/YL/49d8b3o9lNORirpWWVVqNKSqnGo+m6uqFiqrUoVqzapKo8lUZVlqNptoOh5rd2dHg+1NjYa7Gg4GajWbuvTQJep0mlpZXVGjaKjdaarRLNQsGpovFmo2237dRrOpgwcO6uixU6rV0Ww0VLEY6rbbPqtv/MYXqdNuazaX6qKhVqep7Z0dPfuZT9fW1qZUtNXprKgoGqp7HR266qnSYiTVtfwBirYW45lU9NXoHU5rPi92vi+0qIZqtPb9OS4l52/vBvozXmeqcnBM7bXHSOou/Z3rM5Q03rs/62qhosVx5uv25zish+ipnNo5/7FGtFBZzr3U5nO+z72cpvNK82qmTqup+axUYy598G3/Tf3NgfZ3pKKotCik4XjsNVYUtRrNluqiqdXVNS3qUuW8UlGN1uv5ggvZVKtRqDA4cX7a6SKzbGsVXGwveP7jq6miABC5MPwt/d3Ax2ss4vlFZwn48oU0gqbnpJtkDxwforN68WUfgjOQrx3Xm5/5L117wI9VzMZY11qUlYqGNC+nqucLY2M1L7VgQc9Kzee1qkWtuUFvqul0ZkCcTqcaD4ca7GxrZ2dTg+GOpuOJDh04qAP7V9XrdaVGoU63Gxu0Fmo3W1oseN9Cdd3QykpfcxXaHVZaO3BQn/74R9WcD3Tokp
View cpu.h
void
switch_to_process(process_t *proc)
{
/* Set the entry point in MEPC */
asm volatile("csrw mepc, %0" ::"r"(proc->entrypoint));
asm volatile("mv ra, %0" ::"r"(proc->regf->ra));
asm volatile("mv sp, %0" ::"r"(proc->regf->sp));
asm volatile("mv a0, %0" ::"r"(proc));
View gist:7dd37a1e35b4d5af92be725f0efe6129
Debugger entered--Lisp error: (file-error "https://elpa.gnu.org/packages/archive-contents" "Bad Request")
signal(file-error ("https://elpa.gnu.org/packages/archive-contents" "Bad Request"))
package--download-one-archive(("gnu" . "https://elpa.gnu.org/packages/") "archive-contents" nil)
package--download-and-read-archives(nil)
package-refresh-contents()
(if (packages-installed-p) nil (message "%s" "Emacs is now refreshing its package database...") (package-refresh-contents) (message "%s" " done.") (let ((--dolist-tail-- required-packages) p) (while --dolist-tail-- (setq p (car --dolist-tail--)) (if (not (package-installed-p p)) (progn (package-install p))) (setq --dolist-tail-- (cdr --dolist-tail--)))))
eval-buffer(#<buffer *load*-303192> nil "/Users/benmezger/.emacs.d/packages.el" nil t) ; Reading at buffer position 2086
load-with-code-conversion("/Users/benmezger/.emacs.d/packages.el" "/Users/benmezger/.emacs.d/packages.el" nil nil)
load("~/.emacs.d/packages.el")
eval-buffer(#<buffer *lo
View gist:f46ab44d806678ded83963c674e12055
Warning (initialization): An error occurred while loading ‘/Users/benmezger/.emacs.d/init.el’:
error: Package ‘undo-tree-0.6.3’ is unavailable
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.
View Makefile
PROGRAM = main
#############################################################
# Makefile Arguments
#############################################################
# BSP_DIR sets the path to the target-specific board support package.
BSP_DIR ?= $(abspath bsp)
# SRC_DIR sets the path to the program source directory
SRC_DIR ?= $(abspath kernel)
You can’t perform that action at this time.