This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from josx64, but this code is pretty generic. | |
// [kernel] fills in the pagetable entries from the given address | |
// | |
// see for example Intel Dev Guide Vol 3 4.2 | |
_JOS_API_FUNC void pagetables_traverse_tables(void* at, uintptr_t * entries, size_t num_entries) { | |
_JOS_ASSERT(entries &&_4_level_paging && num_entries>=4); | |
memset(entries, 0, 4*sizeof(uintptr_t)); | |
//NOTE: this relies on identity mapping in order to get access to the pagetables themselves |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def post_bin_example(): | |
import requests | |
import numpy as np | |
#NOTE! the dtype used here and on the server have to match and byte ordering isn't considered in this example | |
x = np.random.rand(10).astype(np.float32) | |
print(f'sending {len(x)} floats : {x}') | |
res = requests.post(url=ROOT_PATH+r'/readbin', | |
data=x.tobytes(), | |
headers={'Content-Type': 'application/octet-stream'}) | |
print(res) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# a *very* simple CMake file which will build a valid PE+ 64 bit EFI executable using Clang + LLD-LINK on Windows | |
# with LLVM clang+linker present in an "external" folder as specified below. | |
# | |
# To generate Ninja build scripts for this example: | |
# cmake.exe -H. -G Ninja -Bbuild^ | |
# -DCMAKE_SYSTEM_NAME="Generic"^ | |
# -DCMAKE_C_COMPILER:PATH="%CD%\external\LLVM\bin\clang.exe" -DCMAKE_C_COMPILER_ID="Clang"^ | |
# -DCMAKE_CXX_COMPILER:PATH="%CD%\external\LLVM\bin\clang.exe" -DCMAKE_CXX_COMPILER_ID="Clang"^ | |
# -DCMAKE_LINKER:PATH="%CD%\external\LLVM\bin\lld-link.exe" | |
# |