Last active
March 25, 2018 07:11
-
-
Save roguesherlock/4c5db158f490a84b88f931bf0bbea1d9 to your computer and use it in GitHub Desktop.
Simple functions to aid me in building and running os161 kernel in bash, fish, powershell
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
function makeos | |
switch $argv[1] | |
case 'ast1' | |
set ASST 'ASST1' | |
case 'ast2' | |
set ASST 'ASST2' | |
case 'ast3' | |
set ASST 'ASST3' | |
case '*' | |
set ASST 'DUMBVM' | |
end | |
set BUILDDIR $HOME'/Developer/os161/kern/compile/'$ASST | |
set ROOTDIR $HOME'/os161/root' | |
cd $BUILDDIR | |
bmake; and bmake install; and cd $ROOTDIR | |
echo 'Done!' | |
end |
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
function makeos ($ast = 'DUMBVM'){ | |
switch ($ast) { | |
'ast1' {setx ASST 'ASST1'; break} | |
'ast1' {setx ASST 'ASST1'; break} | |
'ast1' {setx ASST 'ASST1'; break} | |
default {Write-Error 'No such assignment exists!'; return;} | |
} | |
$BUILDDIR = $HOME+'/Developer/os161/kern/compile/'+$ASST | |
$ROOTDIR = $HOME+'/os161/root' | |
Set-Location $BUILDDIR | |
bmake; if($?){bmake install}; if($?){Set-Location $ROOTDIR}; | |
Write-Output 'Done!' | |
} |
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
alias makeos='function _makeos { | |
ASST="" | |
case "$1" in | |
"asst0") | |
ASST="DUMBVM" | |
;; | |
"asst1") | |
ASST="ASST1" | |
;; | |
"asst2") | |
ASST="ASST2" | |
;; | |
"asst3") | |
ASST="ASST3" | |
;; | |
*) | |
echo "No such assignment exists" | |
return 1 | |
esac | |
BUILDDIR=$HOME"/Developer/os161/kern/compile/"$ASST | |
ROOTDIR=$HOME"/os161/root" | |
cd $BUILDDIR | |
bmake && bmake install && cd $ROOTDIR && echo "Done!" | |
}; _makeos' | |
# Add this to your ~/.bashrc or source it. |
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
alias ss='function _ss { | |
ROOTDIR=$HOME"/os161/root" | |
cd $ROOTDIR | |
sys161 kernel | |
}; _ss' | |
alias ssw='function _ssw { | |
ROOTDIR=$HOME"/os161/root" | |
cd $ROOTDIR | |
sys161 -w kernel | |
}; _ssw' | |
alias sg='function _sg { | |
ROOTDIR=$HOME"/os161/root" | |
cd $ROOTDIR | |
os161-gdb -x $ROOTDIR/gdb_commands.txt kernel | |
}; _sg' | |
# Add this to your ~/.bashrc or source it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment