Skip to content

Commit 5cfbbcf

Browse files
authored
Merge pull request #2457 from Kiirx/master
Added documentation to run a cosmos kernel on linux
2 parents c046467 + 68b3957 commit 5cfbbcf

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

Docs/articles/Installation/Running.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,61 @@ The ISO option creates an ISO image of the Cosmos output. This ISO file can be
1010
mounted and booted by most virtualization technologies. In addition, a physical
1111
optical disk can be burned and used to boot physical hardware.
1212

13+
# Linux/Posix
14+
### DISCLAIMER: This article assumes that you are using a debian based operating system
15+
16+
## QEMU
17+
Here you can use a generic run file, you can run it by using `sh run.sh -i <ISO> -m <memory size> -h <hdd image>`.
18+
It has to be at the root directory of the project
19+
20+
QEMU is required and can be installed with `apt-get install qemu-system`.
21+
22+
To create an hdd image, you have to convert this [.vmdk](https://github.com/CosmosOS/Cosmos/blob/master/Build/VMWare/Workstation/Filesystem.vmdk?raw=true) file to a .img wich can then be used by QEMU using the following command
23+
`qemu-img convert -f vmdk -O raw Filesystem.vmdk cosmos.img`
24+
25+
`run.sh:`
26+
```sh
27+
#!/bin/bash
28+
29+
helpFunction()
30+
{
31+
echo ""
32+
echo "Usage: $0 -i <ISO> -m <memory size> -h <hdd image>"
33+
echo "\t-i ISO path to be used"
34+
echo "\t-m Memory size to allocate to the Virtual Machine"
35+
echo "\t-h Hard disk image location, can be created with qemu-img"
36+
exit 1 # Exit script after printing help
37+
}
38+
39+
while getopts "i:m:h:" opt
40+
do
41+
case "$opt" in
42+
i ) ISO="$OPTARG" ;;
43+
m ) MEMORY_SIZE="$OPTARG" ;;
44+
h ) HDD_IMAGE="$OPTARG" ;;
45+
? ) helpFunction ;; # Print helpFunction in case parameter is non-existent
46+
esac
47+
done
48+
49+
# Print helpFunction in case parameters are empty
50+
if [ -z "$ISO" ] || [ -z "$MEMORY_SIZE" ] || [ -z "$HDD_IMAGE" ]
51+
then
52+
echo "Some or all of the parameters are empty";
53+
helpFunction
54+
fi
55+
56+
# Build the project
57+
dotnet build
58+
59+
# Emulate the ISO
60+
qemu-system-x86_64 -boot d -cdrom $ISO -m $MEMORY_SIZE -hda $HDD_IMAGE
61+
```
62+
63+
## Virtualbox
64+
Create a virtual machine and use this [.vmdk](https://github.com/CosmosOS/Cosmos/blob/master/Build/VMWare/Workstation/Filesystem.vmdk?raw=true) as HDD image
65+
66+
# Windows
67+
1368
## VMWare
1469

1570
WMWare Workstation and VMWare Player are the preferred testing environments
@@ -58,3 +113,5 @@ Wait and your os will boot up.
58113
## Hyper-V
59114

60115
Not supported at this time.
116+
117+

0 commit comments

Comments
 (0)