Skip to content

Commit

Permalink
add DevContainer configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
icecoobe committed Dec 16, 2024
1 parent 5f396b5 commit e962087
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// // For format details, see https://aka.ms/devcontainer.json. For config options, see the
// // README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
// {
// "name": "Ubuntu",
// // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
// "image": "mcr.microsoft.com/devcontainers/base:jammy",
// "features": {
// "ghcr.io/devcontainers/features/git-lfs:1": {},
// "ghcr.io/cirolosapio/devcontainers-features/alpine-git:0": {}
// }

// // Features to add to the dev container. More info: https://containers.dev/features.
// // "features": {},

// // Use 'forwardPorts' to make a list of ports inside the container available locally.
// // "forwardPorts": [],

// // Use 'postCreateCommand' to run commands after the container is created.
// // "postCreateCommand": "uname -a",

// // Configure tool-specific properties.
// // "customizations": {},

// // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// // "remoteUser": "root"
// }

{
"name": "Local Dockerfile",
"build": {
"context": "..",
"dockerfile": "../Dockerfile"
},
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"mateuszchudyk.hexinspector",
"DavidAnson.vscode-markdownlint",
"doinkythederp.nasm-language-support",
"jack89ita.open-file-from-path",
"mcu-debug.memory-view",
"NateAGeek.memory-viewer",
"mcu-debug.debug-tracker-vscode",
"ms-vscode.hexeditor",
"iliazeus.vscode-ansi",
// "cschlosser.doxdocgen",
"ms-vscode.makefile-tools"
]
}
},
"runArgs": ["--privileged", "-e", "DISPLAY=host.docker.internal:0.0"]
}
25 changes: 25 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/bin
**/charts
**/docker-compose*
**/compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
54 changes: 54 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
FROM docker/ubuntu:latest
LABEL Name=oslab Version=0.0.1


RUN apt-get -y update && apt install -y build-essential bison flex libgmp3-dev \
libmpc-dev libmpfr-dev texinfo libisl-dev wget make \
libncurses-dev xorg-dev glew-utils unzip x11-utils x11-common \
qemu-system-i386 nasm git gdb dos2unix netcat-traditional

RUN wget https://ftp.gnu.org/gnu/binutils/binutils-2.43.tar.xz
RUN wget https://ftp.gnu.org/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz
RUN wget https://github.com/bochs-emu/Bochs/archive/refs/tags/REL_2_8_FINAL.zip

RUN tar -xf binutils-2.43.tar.xz
RUN tar -xf gcc-14.2.0.tar.xz

RUN mkdir build-binutils && \
cd build-binutils && \
../binutils-2.43/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror &&\
make && \
make install

RUN mkdir build-gcc &&\
cd build-gcc && \
../gcc-14.2.0/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers && \
make all-gcc && \
make all-target-libgcc && \
make install-gcc && \
make install-target-libgcc

RUN unzip REL_2_8_FINAL.zip
WORKDIR /tmp/Bochs-REL_2_8_FINAL/bochs

RUN ./configure \
--build=x86_64 \
--host=x86_64 \
--target=x86_64 \
--enable-cpu-level=6 \
--enable-pci \
--enable-gdb-stub \
--enable-logging \
--enable-fpu \
--enable-sb16=dummy \
--enable-cdrom \
--enable-x86-debugger \
--enable-iodebug \
--disable-docbook \
--with-x11

RUN make
RUN make install

RUN rm -rf /tmp
# CMD ["sh", "-c", "/usr/games/fortune -a | cowsay"]

0 comments on commit e962087

Please sign in to comment.