removing .devcontainer/ from git tracking
This commit is contained in:
@@ -1,221 +0,0 @@
|
||||
|
||||
|
||||
# Stage 1: Building Bochs
|
||||
FROM ubuntu:22.04 as bochs-builder
|
||||
|
||||
# Update and install dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
git \
|
||||
build-essential \
|
||||
libgtk2.0-dev \
|
||||
libncurses5-dev \
|
||||
libncursesw5-dev \
|
||||
libsdl2-dev
|
||||
|
||||
# Clone and build Bochs
|
||||
RUN git clone https://github.com/bochs-emu/Bochs && cd Bochs/bochs && \
|
||||
./configure --enable-smp \
|
||||
--enable-cpu-level=6 \
|
||||
--enable-all-optimizations \
|
||||
--enable-x86-64 \
|
||||
--enable-pci \
|
||||
--enable-vmx \
|
||||
--enable-debugger \
|
||||
--enable-disasm \
|
||||
--enable-debugger-gui \
|
||||
--enable-logging \
|
||||
--enable-fpu \
|
||||
--enable-3dnow \
|
||||
--enable-sb16=dummy \
|
||||
--enable-cdrom \
|
||||
--enable-x86-debugger \
|
||||
--enable-iodebug \
|
||||
--disable-plugins \
|
||||
--disable-docbook \
|
||||
--with-x \
|
||||
--with-x11 \
|
||||
--with-term \
|
||||
--with-sdl2 && \
|
||||
make
|
||||
|
||||
|
||||
FROM ubuntu:22.04 as gcc-builder
|
||||
ARG BINUTILS_VERSION=2.41
|
||||
ARG GCC_VERSION=13.2.0
|
||||
|
||||
# Set the ARGs as environment variables and write them to a file
|
||||
RUN echo "BINUTILS_VERSION=$BINUTILS_VERSION" > /version_env
|
||||
RUN echo "GCC_VERSION=$GCC_VERSION" >> /version_env
|
||||
|
||||
COPY ./files/src /usr/local/src/
|
||||
COPY ./files/gcc/t-x86_64-elf /usr/local/src/gcc-${GCC_VERSION}/gcc/config/i386/
|
||||
COPY ./files/gcc/config.gcc.patch /usr/local/src/gcc-${GCC_VERSION}/gcc/
|
||||
|
||||
# Install cross-compiler prerequisites and remove them in the same RUN command to keep the layer size small
|
||||
RUN set -x \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y \
|
||||
wget \
|
||||
gcc \
|
||||
libgmp3-dev \
|
||||
libmpfr-dev \
|
||||
libisl-dev \
|
||||
libmpc-dev \
|
||||
texinfo bison \
|
||||
flex \
|
||||
make \
|
||||
bzip2 \
|
||||
patch \
|
||||
build-essential \
|
||||
&& mkdir -p /usr/local/src \
|
||||
&& mkdir -p /usr/local/gcc-install \
|
||||
&& cd /usr/local/src \
|
||||
&& wget -q https://ftp.gnu.org/gnu/binutils/binutils-${BINUTILS_VERSION}.tar.gz \
|
||||
&& wget -q https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.gz \
|
||||
&& tar zxf binutils-${BINUTILS_VERSION}.tar.gz \
|
||||
&& tar zxf gcc-${GCC_VERSION}.tar.gz \
|
||||
&& rm binutils-${BINUTILS_VERSION}.tar.gz gcc-${GCC_VERSION}.tar.gz \
|
||||
&& chown -R root:root binutils-${BINUTILS_VERSION} \
|
||||
&& chown -R root:root gcc-${GCC_VERSION} \
|
||||
&& chmod -R o-w,g+w binutils-${BINUTILS_VERSION} \
|
||||
&& chmod -R o-w,g+w gcc-${GCC_VERSION} \
|
||||
&& cd /usr/local/src \
|
||||
&& bash build-binutils.sh ${BINUTILS_VERSION} /usr/local \
|
||||
&& bash build-gcc.sh ${GCC_VERSION} /usr/local \
|
||||
# Now remove the build dependencies
|
||||
&& apt-get purge -y --auto-remove \
|
||||
wget \
|
||||
gcc \
|
||||
texinfo bison \
|
||||
flex \
|
||||
make \
|
||||
bzip2 \
|
||||
patch \
|
||||
libisl-dev \
|
||||
libmpc-dev \
|
||||
build-essential \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
|
||||
FROM ubuntu:22.04 as devcontainer
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libgtk2.0-0 \
|
||||
libncurses5 \
|
||||
libsdl2-2.0-0 \
|
||||
git \
|
||||
sudo \
|
||||
make \
|
||||
cmake \
|
||||
nasm \
|
||||
ninja-build \
|
||||
xorriso \
|
||||
qemu \
|
||||
qemu-kvm \
|
||||
qemu-system-x86 \
|
||||
qemu \
|
||||
gdb-multiarch \
|
||||
tmux \
|
||||
dosfstools \
|
||||
libisl-dev \
|
||||
libmpc-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy GCC installation from the first stage
|
||||
COPY --from=gcc-builder /usr/local/src /usr/local/src
|
||||
RUN cd /usr/local/src/build-binutils && make install && cd /usr/local/src/build-gcc && make install-gcc && make install-target-libgcc
|
||||
|
||||
|
||||
# Copy Bochs binaries from the builder stage
|
||||
COPY --from=bochs-builder /Bochs/bochs/bochs /usr/local/bin/
|
||||
COPY --from=bochs-builder /Bochs/bochs/bximage /usr/local/bin/
|
||||
COPY --from=bochs-builder /Bochs/bochs/bios/BIOS-bochs-latest /usr/local/share/bochs/BIOS-bochs-latest
|
||||
COPY --from=bochs-builder /Bochs/bochs/bios/VGABIOS-lgpl-latest /usr/local/share/bochs/VGABIOS-lgpl-latest
|
||||
|
||||
# Download the latest Limine binary release.
|
||||
RUN cd /usr/local && git clone https://github.com/limine-bootloader/limine.git --branch=v6.x-branch-binary --depth=1 && make -C limine
|
||||
|
||||
|
||||
|
||||
RUN groupadd -g 61000 osdev; \
|
||||
useradd -g 61000 -l -m -s /bin/bash -u 61000 osdev; \
|
||||
mkdir -p /home/osdev/supervisor; \
|
||||
touch /home/osdev/.Xauthority; \
|
||||
chown -R osdev:osdev /home/osdev;\
|
||||
chmod -R 777 /home/osdev ;\
|
||||
adduser osdev sudo;\
|
||||
echo 'osdev:osdev' | chpasswd;\
|
||||
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers;
|
||||
|
||||
RUN apt-get remove -y gcc && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set default command to launch Supervisor
|
||||
COPY ./files/entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
RUN chmod +x /usr/local/bin/entrypoint.sh && chown osdev:osdev /usr/local/bin/entrypoint.sh
|
||||
|
||||
# LIBGL_ALWAYS_INDIRECT=1
|
||||
ENV LIBGL_ALWAYS_INDIRECT=1
|
||||
|
||||
|
||||
USER osdev
|
||||
WORKDIR /home/osdev
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||
|
||||
|
||||
|
||||
|
||||
# Create GUI
|
||||
FROM devcontainer as devcontainer-webgui
|
||||
|
||||
USER root
|
||||
|
||||
ENV DISPLAY=:1 \
|
||||
VNC_PORT=5901 \
|
||||
NO_VNC_PORT=6901 \
|
||||
VNC_COL_DEPTH=32 \
|
||||
VNC_RESOLUTION=1920x1080 \
|
||||
TERM=xterm \
|
||||
DEBIAN_FRONTEND=noninteractive \
|
||||
NOVNC_VERSION="v1.4.0" \
|
||||
WEBSOCKIFY_VERSION="v0.11.0"
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
supervisor \
|
||||
xvfb \
|
||||
xauth \
|
||||
dbus-x11 \
|
||||
xfce4 \
|
||||
xfce4-terminal \
|
||||
x11-xserver-utils \
|
||||
x11-utils \
|
||||
tigervnc-standalone-server \
|
||||
tigervnc-common \
|
||||
python3-numpy \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
|
||||
# Install NOVNC.
|
||||
RUN git clone --branch ${NOVNC_VERSION} --single-branch https://github.com/novnc/noVNC.git /opt/noVNC; \
|
||||
git clone --branch ${WEBSOCKIFY_VERSION} --single-branch https://github.com/novnc/websockify.git /opt/noVNC/utils/websockify; \
|
||||
ls -la /opt/noVNC; \
|
||||
ln -s /opt/noVNC/vnc.html /opt/noVNC/index.html
|
||||
|
||||
|
||||
# Supervisor configuration files
|
||||
COPY ./files/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
COPY ./files/supervisor/novnc.conf /etc/supervisor/conf.d/novnc.conf
|
||||
COPY ./files/supervisor/vncserver.conf /etc/supervisor/conf.d/vncserver.conf
|
||||
# Expose VNC and noVNC ports
|
||||
EXPOSE ${VNC_PORT} ${NO_VNC_PORT}
|
||||
|
||||
USER osdev
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
// Guide 1 ///////////////////////////////////////////////////////////
|
||||
// MacOS - X Forwarding
|
||||
// https://gist.github.com/cschiewek/246a244ba23da8b9f0e7b11a68bf3285
|
||||
// 1. brew install --cask xquartz
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
{
|
||||
"name": "Ubuntu",
|
||||
"postStartCommand": "/usr/local/bin/entrypoint.sh",
|
||||
"remoteUser": "osdev",
|
||||
"features": {},
|
||||
"forwardPorts": [],
|
||||
|
||||
////////////////////////////////////
|
||||
// UNCOMMENT to use prebuilt image
|
||||
////////////////////////////////////
|
||||
"image": "ghcr.io/uiaict/2024-ikt218-osdev/devcontainer:2776417",
|
||||
|
||||
////////////////////////////////////
|
||||
// UNCOMMENT to build manually
|
||||
////////////////////////////////////
|
||||
//"build": {
|
||||
// "dockerfile": "Dockerfile",
|
||||
// "target": "devcontainer"
|
||||
//},
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
// Linux Setup (X11)
|
||||
////////////////////////////////////
|
||||
//"mounts": [
|
||||
//"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached"
|
||||
//],
|
||||
//"containerEnv": {},
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
// Windows Setup (WSL2)
|
||||
////////////////////////////////////
|
||||
//"mounts": [
|
||||
// "source=/mnt/wslg,target=/mnt/wslg,type=bind,consistency=cached"
|
||||
//],
|
||||
//"containerEnv": {
|
||||
// "PULSE_SERVER": "/mnt/wslg/PulseServer"
|
||||
//},
|
||||
|
||||
|
||||
////////////////////////////////////
|
||||
// MacOS Setup (X11)
|
||||
// You need to install XQuartz and pulseaudio
|
||||
////////////////////////////////////
|
||||
//"containerEnv": {
|
||||
// "DISPLAY": "docker.for.mac.host.internal:0",
|
||||
// "PULSE_SERVER": "docker.for.mac.host.internal:4713"
|
||||
//},
|
||||
//"mounts": [
|
||||
// "source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached",
|
||||
// "source=${localEnv:HOME}/.config/pulse,target=/home/osdev/.config/pulse,type=bind,consistency=cached"
|
||||
//],
|
||||
|
||||
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"ms-vscode.cmake-tools",
|
||||
"ms-azuretools.vscode-docker",
|
||||
"ms-vscode-remote.remote-containers",
|
||||
"twxs.cmake",
|
||||
"ms-vscode.cpptools",
|
||||
"ms-vscode.cpptools-extension-pack",
|
||||
"GitHub.copilot",
|
||||
"webfreak.debug",
|
||||
"13xforever.language-x86-64-assembly",
|
||||
"DamianKoper.gdb-debug"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Start supervisord in the background and redirect its output to /dev/null
|
||||
|
||||
# open supervisord in tmux
|
||||
tmux new-session -d -s supervisord
|
||||
tmux send-keys -t supervisord "/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf" C-m
|
||||
|
||||
# End of entrypoint
|
||||
# -----------------
|
||||
@@ -1,10 +0,0 @@
|
||||
--- config.gcc 2016-04-11 03:14:59.000000000 -0700
|
||||
+++ config.gcc.new 2016-04-27 13:47:22.444331746 -0700
|
||||
@@ -1420,6 +1420,7 @@
|
||||
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h"
|
||||
;;
|
||||
x86_64-*-elf*)
|
||||
+ tmake_file="${tmake_file} i386/t-x86_64-elf" # include the new multilib configuration
|
||||
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h"
|
||||
;;
|
||||
x86_64-*-rtems*)
|
||||
@@ -1,4 +0,0 @@
|
||||
# Add libgcc multilib variant without red-zone requirement
|
||||
|
||||
MULTILIB_OPTIONS += mno-red-zone
|
||||
MULTILIB_DIRNAMES += no-red-zone
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
BINUTILS_VERSION=$1
|
||||
|
||||
|
||||
export PREFIX=$2
|
||||
#export TARGET=x86_64-elf
|
||||
export TARGET=i686-elf
|
||||
export PATH="$PREFIX/bin:$PATH"
|
||||
|
||||
cd $PREFIX/src
|
||||
mkdir build-binutils
|
||||
cd build-binutils
|
||||
../binutils-${BINUTILS_VERSION}/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
|
||||
make -j `nproc`
|
||||
make install
|
||||
|
||||
cd $PREFIX/src
|
||||
#rm -rf build-binutils.sh binutils-${BINUTILS_VERSION}
|
||||
# rm -rf build-binutils
|
||||
@@ -1,24 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
GCC_VERSION=$1
|
||||
|
||||
export PREFIX=$2
|
||||
#export TARGET=x86_64-elf
|
||||
export TARGET=i686-elf
|
||||
export PATH="$PREFIX/bin:$PATH"
|
||||
|
||||
cd $PREFIX/src/gcc-${GCC_VERSION}/gcc
|
||||
patch < config.gcc.patch
|
||||
|
||||
cd $PREFIX/src
|
||||
mkdir build-gcc
|
||||
cd build-gcc
|
||||
../gcc-${GCC_VERSION}/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers
|
||||
make -j `nproc` all-gcc
|
||||
make -j `nproc` all-target-libgcc
|
||||
make install-gcc
|
||||
make install-target-libgcc
|
||||
|
||||
cd $PREFIX/src
|
||||
#rm -rf build-gcc.sh gcc-${GCC_VERSION}
|
||||
# rm -rf build-gcc
|
||||
@@ -1,46 +0,0 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
childlogdir=/home/osdev/supervisor/
|
||||
logfile=/home/osdev/supervisor/supervisord.log
|
||||
logfile_maxbytes=50MB
|
||||
logfile_backups=10
|
||||
loglevel=info
|
||||
pidfile=/home/osdev/supervisor/supervisord.pid
|
||||
|
||||
|
||||
[inet_http_server]
|
||||
port=9001
|
||||
|
||||
|
||||
[program:novnc]
|
||||
priority=49
|
||||
command=/opt/noVNC/utils/novnc_proxy --vnc localhost:%(ENV_VNC_PORT)s --listen %(ENV_NO_VNC_PORT)s
|
||||
user=osdev
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
|
||||
[program:vncserver]
|
||||
priority=50
|
||||
command=/usr/bin/Xtigervnc %(ENV_DISPLAY)s -depth %(ENV_VNC_COL_DEPTH)s -geometry %(ENV_VNC_RESOLUTION)s -SecurityTypes None -localhost no
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
|
||||
[program:xfce4]
|
||||
priority=50
|
||||
command=/usr/bin/startxfce4
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
[program:websockify]
|
||||
command=/usr/bin/python3 /opt/noVNC/utils/websockify/run --web /opt/noVNC/ ${NO_VNC_PORT} localhost:${VNC_PORT}
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
Reference in New Issue
Block a user