Back to Blog List

[OS] Mac Pintos Setting

โ†Tip

Welcome to Pintos. Pintos is a simple operating system framework for the 80x86 architecture.

Docker Build

https://github.com/NamJeongseok/PintOS-Docker-UNIST

bash
FROM ubuntu:12.04 RUN sed -i -e 's/archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list RUN sed -i -e 's/security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list RUN apt-get update && apt-get install -y \\ bash \\ vim \\ build-essential \\ gcc-4.4 \\ gcc-multilib \\ g++-4.4 \\ perl \\ wget \\ patch \\ libncurses5-dev \\ libx11-dev libxrandr-dev xorg-dev \\ make RUN mv /usr/bin/gcc-4.4 /usr/bin/gcc RUN mv /usr/bin/g++-4.4 /usr/bin/g++ COPY ./bochs-2.2.6.tar.gz /root/ RUN mkdir /root/pintos RUN echo 'export PATH="$PATH:/root/pintos/src/utils"' >> ~/.bashrc CMD ["/bin/bash"]
bash
git clone git@github.com:NamJeongseok/PintOS-Docker-UNIST.git cd PintOS-Docker-UNIST
  • amd64 (x86_64) (Window)
bash
sudo docker build -t pintos .
  • ARM64 (Silicon Mac)
bash
docker build --platform=linux/amd64 -t pintos .

Error

bash
โžœ PintOS-Docker-UNIST git:(main) sudo docker build -t pintos . Password: [+] Building 1.8s (9/14) docker:desktop-linux => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 696B 0.0s => [internal] load metadata for docker.io/library/ubuntu:12.04 1.5s => [auth] library/ubuntu:pull token for registry-1.docker.io 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [1/9] FROM docker.io/library/ubuntu:12.04@sha256:18305429afa14ea462f810146ba44d4363ae76e4c8d 0.0s => => resolve docker.io/library/ubuntu:12.04@sha256:18305429afa14ea462f810146ba44d4363ae76e4c8d 0.0s => [internal] load build context 0.0s => => transferring context: 42B 0.0s => CACHED [2/9] RUN sed -i -e 's/archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources 0.0s => CACHED [3/9] RUN sed -i -e 's/security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/source 0.0s => ERROR [4/9] RUN apt-get update && apt-get install -y bash vim build-essential gcc-4.4 g 0.2s ------ > [4/9] RUN apt-get update && apt-get install -y bash vim build-essential gcc-4.4 gcc-multilib g++-4.4 perl wget patch libncurses5-dev libx11-dev libxrandr-dev xorg-dev make: 0.202 qemu: uncaught target signal 11 (Segmentation fault) - core dumped 0.206 E: Method http has died unexpectedly! 0.207 E: Sub-process http received a segmentation fault. ------ 1 warning found (use docker --debug to expand): - InvalidBaseImagePlatform: Base image ubuntu:12.04 was pulled with platform "linux/amd64", expected "linux/arm64" for current build (line 1) Dockerfile:6 -------------------- 5 | 6 | >>> RUN apt-get update && apt-get install -y \\ 7 | >>> bash \\ 8 | >>> vim \\ 9 | >>> build-essential \\ 10 | >>> gcc-4.4 \\ 11 | >>> gcc-multilib \\ 12 | >>> g++-4.4 \\ 13 | >>> perl \\ 14 | >>> wget \\ 15 | >>> patch \\ 16 | >>> libncurses5-dev \\ 17 | >>> libx11-dev libxrandr-dev xorg-dev \\ 18 | >>> make 19 | -------------------- ERROR: failed to solve: process "/bin/sh -c apt-get update && apt-get install -y \\tbash \\tvim \\tbuild-essential \\tgcc-4.4 \\tgcc-multilib \\tg++-4.4 \\tperl \\twget \\tpatch \\tlibncurses5-dev \\tlibx11-dev libxrandr-dev xorg-dev \\tmake" did not complete successfully: exit code: 100 View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/307xpyqphklv4cd5fc8tmb1eg

Rosetta ํ‚ค๊ธฐ

๋‚ด๊ฐ€ ์ „์— ํ•€ํ† ์Šค ๋ฏธ๋ฆฌ ํ•ด๋ณด๋ ค๊ณ  ๋ธ”๋กœ๊ทธ ์ฐพ์•„๋ณด๋‹ค๊ฐ€ ์ด ์„ค์ •์„ ๊บผ์•ผ x86์œผ๋กœ ํ™•์‹คํ•˜๊ฒŒ ๋Œ์•„๊ฐ„๋‹ค๊ณ  ํ•ด์„œ ๊บผ๋†จ์—ˆ๋Š”๋ฐ, ์ด๊ฑฐ ํ‚ค๋‹ˆ๊นŒ ์ž˜ ๋œ๋‹ค.

Blog Image

์ด์ „์— ํ•€ํ† ์Šค ๋ฏธ๋ฆฌ ํ•ด๋ณด๋ ค๊ณ  ํ• ๋•Œ, ์–ด๋–ค ๋ธ”๋กœ๊ทธ ๋ณด๊ณ 

์ €๊ฑธ ๊บผ์•ผ x86์œผ๋กœ ์ •ํ™•ํžˆ ์ž‘๋™ํ•œ๋‹ค๊ณ  ํ•ด์„œ ๊บผ๋†จ์—ˆ๋Š”๋ฐ, ์ด๊ฒŒ ๋ฌธ์ œ์˜€๋‹ค.

Docker์—์„œ๋Š” --platform=linux/amd64 ์˜ต์…˜์œผ๋กœ x86 ์ด๋ฏธ์ง€๋ฅผ ์‹คํ–‰ํ•  ๋•Œ, ๋‚ด๋ถ€์ ์œผ๋กœ QEMU๋ฅผ ์ด์šฉํ•ด ์—๋ฎฌ๋ ˆ์ด์…˜ํ•จ.

์ด๋•Œ Rosetta๋ฅผ ํ™œ์„ฑํ™”ํ•˜๋ฉด QEMU๊ฐ€ ๋” ์•ˆ์ •์ ์ด๊ณ  ๋น ๋ฅด๊ฒŒ ๋™์ž‘ํ•จ. ํŠนํžˆ ์˜ค๋ž˜๋œ ๋ฆฌ๋ˆ…์Šค ์ด๋ฏธ์ง€(Ubuntu 12.04 ๊ฐ™์€ ๊ฑฐ)์—์„œ apt-get์ด ์ฃฝ๊ฑฐ๋‚˜ ์„ธ๊ทธํดํŠธ ๋‚˜๋Š” ๊ฒฝ์šฐ, ๋Œ€๋ถ€๋ถ„ Rosetta ๊บผ์ ธ ์žˆ์–ด์„œ ์ƒ๊ธฐ๋Š” ๋ฌธ์ œ์ž„.

๋นŒ๋“œ ์„ฑ๊ณต

bash
docker build --platform=linux/amd64 -t pintos .
Blog Image

Start

bash
wget [<http://www.stanford.edu/class/cs140/projects/pintos/pintos.tar.gz>](<http://www.stanford.edu/class/cs140/projects/pintos/pintos.tar.gz>)
bash
tar xvf pintos.tar.

ํŒŒ์ผ ๊ถŒํ•œ ์—๋Ÿฌ ํ•ด๊ฒฐ

์ง„์งœ ์ด๊ฑฐ๋•Œ๋ฌธ์— ๊ฐœ๊ณ ์ƒํ–ˆ์Œโ€ฆ

Stanford์—์„œ ๋ฐ›์€ ํŒŒ์ผ์ด ๊ถŒํ•œ์ด ์—†๋Š” ์ฑ„๋กœ ์ฃผ๋Š”๋ฐ,

์œˆ๋„์šฐ์—์„œ๋Š” ์›๋ž˜ ์ƒ๊ด€์ด ์—†์–ด์„œ ๊ดœ์ฐฎ์€๋ฐ,

๋งฅ์—์„œ๋Š” ์‹คํ–‰ ๋ถˆ๊ฐ€๋Šฅํ•œ์ฑ„๋กœ ์••์ถ•์ด ํ’€์–ด์ ธ์„œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•จ.

๊ทผ๋ฐ ์ด๊ฒŒ ๋˜ ์ด ์ƒํƒœ๋กœ Docker๋กœ ์˜ฎ๊ฒจ์„œ ๊ทธ๋ƒฅ Permission Denied ํ•ด๋ฒ„๋ฆฌ๋‹ˆ๊นŒ

์ด๊ฒŒ ๋„๋Œ€์ฒด ์™œ ๊ทธ๋Ÿฐ์ง€ GPT ์จ๋„ ์ž˜ ๋ชฐ๋ž์Œ.

Docker ๋„˜์–ด๊ฐ€๊ธฐ ์ „๋ถ€ํ„ฐ ์›๋ณธ ํŒŒ์ผ ๊ถŒํ•œ์ด ๋ถ€์กฑํ•ด์„œ ๊ทธ๋Ÿฐ๊ฑด๋ฐ Docker ํŒŒ์ผ ๊ณต์œ  ๋ฐฉ์‹๋•Œ๋ฌธ์ธ์ค„์•Œ๊ณ  ์‚ฝ์งˆํ•จ

bash
xattr -rc pintos/
bash
chmod -R u+rwX,go+rX pintos/
bash
find pintos/ -type f -exec ls -l {} \\;

์œ„ ๋ช…๋ น์–ด ํ•˜๋ฉด ์•„๋ž˜์ฒ˜๋Ÿผ file permission์ด ๋œธ

bash
-rw-r--r--@ 1 hoon staff 333 9 27 2012 pintos//src/Makefile.kernel -rwxr-xr-x@ 1 hoon staff 1486 9 27 2012 pintos//src/misc/bochs-2.2.6-build.sh -rw-r--r--@ 1 hoon staff 511 9 27 2012 pintos//src/misc/bochs-2.2.6-solaris-link.patch

์—ฌ๊ธฐ ๋ณด๋ฉด ์‹คํ–‰ ๊ฐ€๋Šฅํ•œ ํŒŒ์ผ (.sh) ํŒŒ์ผ ๋“ฑ์— x ํ‘œ์‹œ๊ฐ€ ์ƒ๊ธธ๊ฒƒ์ž„.

๋˜๋Š” ์‹คํ–‰ ๊ฐ€๋Šฅํ•œ ํŒŒ์ผ๋งŒ ๊ถŒํ•œ ๋ณด๋ ค๋ฉด

bash
find pintos/ -type f -perm -111 -exec ls -l {} \\;

์•„๋ž˜์ฒ˜๋Ÿผ ๋๋‹ค๋ฉด ์„ฑ๊ณต

bash
-rwxr-xr-x@ 1 hoon staff 1486 9 27 2012 pintos//src/misc/bochs-2.2.6-build.sh -rwxr-xr-x@ 1 hoon staff 4096 9 27 2012 pintos//src/tests/make-grade -rwxr-xr-x@ 1 hoon staff 2951 9 27 2012 pintos//src/utils/backtrace -rwxr-xr-x@ 1 hoon staff 4563 9 27 2012 pintos//src/utils/pintos-mkdisk -rwxr-xr-x@ 1 hoon staff 429 9 27 2012 pintos//src/utils/pintos-gdb -rwxr-xr-x@ 1 hoon staff 29821 9 27 2012 pintos//src/utils/pintos

์ปจํ…Œ์ด๋„ˆ ๋“ค์–ด๊ฐ€๊ธฐ ์ „์— ๋กœ์ปฌ์—์„œ ํŽธํ•˜๊ฒŒ bochs ํŒŒ์ผ ์ˆ˜์ •

pintos/src/misc/bochs-2.2.6-build.sh

Blog Image
  • ๋‹ค์Œ ๋‚ด์šฉ์œผ๋กœ ์ˆ˜์ •
bash
CFGOPTS="--enable-cpu-level=6 --with-x --with-x11 --with-term --with-nogui --prefix=$DSTDIR"

docker run

๋“œ๋””์–ด ์ œ๋Œ€๋กœ ์‹คํ–‰ํ•ด๋ณด์ž.

bash
docker run --platform=linux/amd64 -it -p 80:80 \\ -v /Users/hoon/github/pintos/pintos:/root/pintos \\ --name pintos pintos

boch 2.6.6 ์„ค์น˜

  • ์œ„์—์„œ VSCode๋กœ bochs ์ˆ˜์ • ์•ˆํ–ˆ๋‹ค๋ฉด
    bash
    cd pintos/src/misc
    bash
    vi bochs-2.2.6-build.sh
    i : ์ˆ˜์ • ๋ชจ๋“œ
    ์ˆ˜์ •...
    ESC : ์ˆ˜์ • ๋ชจ๋“œ ๋‚˜๊ฐ€๊ธฐ
    :wq : ์ €์žฅ ํ›„ ์ข…๋ฃŒ
    • ๋‹ค์Œ ๋‚ด์šฉ์œผ๋กœ ์ˆ˜์ •
    bash
    CFGOPTS="--enable-cpu-level=6 --with-x --with-x11 --with-term --with-nogui --prefix=$DSTDIR"
๐Ÿ“ข ๋งŒ์•ฝ Container๋ฅผ ์‚ญ์ œํ•ด์„œ ๋‹ค์‹œ Runํ•œ๋‹ค๋ฉด ์ด ๊ณผ์ •์„ ๋‹ค์‹œ ํ•ด์ค˜์•ผํ•œ๋‹ค.
bash
cd /root/pintos/src/misc
bash
env SRCDIR=/root/ PINTOSDIR=/root/pintos/ DSTDIR=/usr/local ./bochs-2.2.6-build.sh
bash
which bochs bochs -v

Test

bash
cd /root/pintos/src/threads
bash
make
bash
cd build
bash
pintos -q run alarm-multiple
Blog Image

github repo ์ƒ์„ฑ

https://github.com/hoonably/pintos

root/pintos/src ์—์„œ ์‹œ์ž‘ํ•˜๊ธฐ

ํ• ๋•Œ๋งˆ๋‹ค root ํด๋”์—์„œ ์‹œ์ž‘ํ•˜๋Š”๋ฐฉ๋ฒ•

ํ•œ๋ฒˆ ์ณ์ฃผ๋ฉด ํ•ญ์ƒ ์ ์šฉ๋จ.

๋„์ปคํŒŒ์ผ์— ๋‹ค์Œ ์ค„์„ ๋„ฃ์–ด๋„ ๋˜๊ธด ํ•จ.

docker
WORKDIR /root/pintos/src

๊ทผ๋ฐ ์ด๋ฏธ ๋นŒ๋“œํ–ˆ์œผ๋‹ˆ ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์ปจํ…Œ์ด๋„ˆ ๋‚ด๋ถ€์—์„œ ์น˜๋ฉด ๋จ

bash
echo 'cd /root/pintos/src' >> ~/.bashrc
  • ์ดํ›„ bashrc ์ƒํ™ฉ
    bash
    cat ~/.bashrc
    bash
    ... ๋งจ ์•„๋ž˜์ค„์— ๋‹ค์Œ ๋‘์ค„์ด ์žˆ์œผ๋ฉด ์„ฑ๊ณต export PATH="$PATH:/root/pintos/src/utils" cd /root/pintos/src

ํ•œ๋ฒˆ Run ์ดํ›„ Container ์‹œ์ž‘

Blog Image

์ปจํ…Œ์ด๋„ˆ์—์„œ exit ๋ฅผ ํ–ˆ๋‹ค๋ฉด,

์œ„์ฒ˜๋Ÿผ Container๋Š” ๋‚จ์•„์žˆ๊ณ , ์ค‘์ง€๋˜์–ด์žˆ์„ ๊ฒƒ์ด๋‹ค.

bash
docker start -ai pintos

๋‚˜์ค‘์— ๋˜ ๊ฐ™์€ ๋ฐฉ์‹์œผ๋กœ exit ํ•˜๊ณ  ๋ฐ˜๋ณตํ•˜๋ฉด ๋œ๋‹ค.

Branch

๋ธŒ๋žœ์น˜ ์ƒ์„ฑ

bash
git checkout -b [your-branch-name]
bash
git checkout -b feat/alarm-clock

๐Ÿ“ค ๋งŒ๋“  ๋ธŒ๋žœ์น˜๋ฅผ GitHub์— ํ‘ธ์‹œ

bash
git push -u origin [your-branch-name]
bash
git push -u origin feat/alarm-clock
  • u ์˜ต์…˜์€ ์ดํ›„ git push/pull ์‹œ ๋ธŒ๋žœ์น˜ ์ด๋ฆ„ ์ƒ๋žต ๊ฐ€๋Šฅํ•˜๊ฒŒ ์—ฐ๊ฒฐํ•ด์คŒ
  • ๋‹ค์Œ๋ถ€ํ„ฐ ๊ทธ๋ƒฅ push ํ•ด๋„ ๋จ.
  • ์™œ feat/ ๋ฅผ ์“ฐ๋Š”๊ฐ€?

    ๋ธŒ๋žœ์น˜ ์ด๋ฆ„ ํŒจํ„ด

    Prefix์˜๋ฏธ์˜ˆ์‹œ ๋ธŒ๋žœ์น˜๋ช…
    feat/์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ์ถ”๊ฐ€feat/alarm-clock
    fix/๋ฒ„๊ทธ ์ˆ˜์ •fix/overflow-bug
    refactor/์ฝ”๋“œ ๋ฆฌํŒฉํ† ๋ง (๊ธฐ๋Šฅ ๋ณ€ํ™” X)refactor/thread-init
    test/ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ถ”๊ฐ€/์ˆ˜์ •test/userprog-tests
    doc/๋ฌธ์„œ, README ์ˆ˜์ •doc/setup-instructions
    chore/๋นŒ๋“œ, ์„ค์ • ๋ณ€๊ฒฝ ๋“ฑ ์žก์ผchore/dockerfile-update
    hotfix/๊ธ‰ํ•œ ๋ฒ„๊ทธ ์ˆ˜์ • (๋ฐฐํฌ ํ›„)hotfix/build-crash

    ์™œ ์ด๋ ‡๊ฒŒ ์“ฐ๋‚˜?

    • ํ˜‘์—… ์ค‘์— ๋ธŒ๋žœ์น˜๊ฐ€ ๋งŽ์•„์งˆ ๋•Œ โ†’ ์ด๋ฆ„๋งŒ ๋ณด๊ณ  ์šฉ๋„ ํŒŒ์•… ๊ฐ€๋Šฅ
    • GitHub Pull Request์—์„œ ์ž๋™ ์ •๋ ฌ์ด๋‚˜ ํ•„ํ„ฐ๋„ ํŽธ๋ฆฌํ•จ
    • ํŒ€ ๋‚ด๋ถ€์—์„œ ์ผ๊ด€๋œ ์Šคํƒ€์ผ ์œ ์ง€ ๊ฐ€๋Šฅ
    • ์ผ๋ถ€ ์ž๋™ํ™” ๋„๊ตฌ(CI/CD, Release notes)์™€๋„ ์ž˜ ํ˜ธํ™˜๋จ
  • VSCode์—์„œ ํ•œ๋‹ค๋ฉด ์ด๋ ‡๊ฒŒ ์ปค๋ฐ‹ ์–ด๋””์— ํ•˜๋Š”๊ฑด์ง€ ํ™•์ธํ•ด ๋ณผ ์ˆ˜ ์žˆ์Œ
Blog Image

Github Pull ์ดํ›„ Error

์ด๊ฑด ๋งฅ์—์„œ ๋ฐœ์ƒํ•œ ๊ฒƒ์€ ์•„๋‹ˆ๊ณ , ํŒ€์› ์œˆ๋„์šฐ์—์„œ git pull ํ•ด์˜จ ํ›„ .sh ํŒŒ์ผ์„ ์‹คํ–‰ํ–ˆ์„ ๋•Œ ๋‚˜๋Š” ๋ฌธ์ œ๋‹ค.

bash
root@04fedab3f530:~/pintos/src/misc# env SRCDIR=/root/ PINTOSDIR=/root/pintos/ DSTDIR=/usr/local bash ./bochs-2.2.6-build.sh ./bochs-2.2.6-build.sh: line 2: $'\\r': command not found ./bochs-2.2.6-build.sh: line 41: syntax error: unexpected end of file
  1. $'\\r': command not found

    ์ด ๋ฉ”์‹œ์ง€๋Š” ํŒŒ์ผ์ด Windows ์Šคํƒ€์ผ ์ค„๋ฐ”๊ฟˆ (CRLF) ์œผ๋กœ ์ €์žฅ๋˜์–ด ์žˆ์–ด์„œ ๋ฐœ์ƒํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์œ ๋‹‰์Šค/๋ฆฌ๋ˆ…์Šค์—์„œ๋Š” LF (\n) ์ค„๋ฐ”๊ฟˆ๋งŒ ์‚ฌ์šฉํ•ด์•ผ ํ•˜๋ฏ€๋กœ, ์ด ์Šคํฌ๋ฆฝํŠธ๋Š” ๋ฆฌ๋ˆ…์Šค์—์„œ ์ง์ ‘ ์‹คํ–‰๋˜๊ธฐ ์ „์— ํฌ๋งท์„ ๋ณ€ํ™˜ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

  1. syntax error: unexpected end of file

    ์ค„๋ฐ”๊ฟˆ ๋ฌธ์ œ๋กœ ์ธํ•ด ์‰˜์ด ์Šคํฌ๋ฆฝํŠธ์˜ ๊ตฌ์กฐ๋ฅผ ์ œ๋Œ€๋กœ ํ•ด์„ํ•˜์ง€ ๋ชปํ•ด ๋๋ถ€๋ถ„์—์„œ ๋ฌธ๋ฒ• ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•œ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

  • ์œˆ๋„์šฐ์—์„œ git์„ ์„ค์น˜ํ•˜๋ฉด ๊ธฐ๋ณธ์ ์œผ๋กœ ๋‹ค์Œ ์„ค์ •์ธ๋ฐ, ์ด๊ฒŒ ๋ฌธ์ œ๋‹ค.
bash
core.autocrlf=true

์ด ์„ค์ •์€:

  • clone/pull ํ•  ๋•Œ โ†’ CRLF๋กœ ๋ณ€ํ™˜
  • commit/push ํ•  ๋•Œ โ†’ LF๋กœ ๋˜๋Œ๋ฆผ

์ฆ‰, ์นœ๊ตฌ๊ฐ€ pullํ•  ๋•Œ .sh ํŒŒ์ผ์ด CRLF๋กœ ๋ฐ”๋€Œ์–ด๋ฒ„๋ฆฐ ๊ฒƒ์ด๋‹ค.

Docker ์šฐ๋ถ„ํˆฌ ์ปจํ…Œ์ด๋„ˆ๋Š” ๋ฆฌ๋ˆ…์Šค๋‹ˆ๊นŒ CRLF ํ•ด์„ ๋ชป ํ•จ โ†’ ์—๋Ÿฌ ๋ฐœ์ƒ

ํ•ด๊ฒฐ๋ฐฉ๋ฒ•

bash
git config --global core.autocrlf # ํ˜„์žฌ ์„ค์ • ํ™•์ธ
๊ฒฐ๊ณผ์˜๋ฏธ
true์œˆ๋„์šฐ์šฉ: pullํ•  ๋•Œ CRLF, pushํ•  ๋•Œ LF
input๋งฅ/๋ฆฌ๋ˆ…์Šค์šฉ: pullํ•  ๋•Œ LF ์œ ์ง€, pushํ•  ๋•Œ LF
(์•„๋ฌด๊ฒƒ๋„ ์—†์Œ)๊ธฐ๋ณธ๊ฐ’ ์‚ฌ์šฉ ์ค‘ (๋ณดํ†ต OS์— ๋”ฐ๋ผ ๋‹ค๋ฅด๊ฒŒ ์ž‘๋™)
bash
git config --global core.autocrlf input

์ด๋ฏธ ๋ฐ›์€ ํŒŒ์ผ ๊ณ ์น˜๊ธฐ

๊ทธ๋ƒฅ ์ง์ ‘ ์ค„๋ฐ”๊ฟˆ ์Šคํƒ€์ผ์„ ๋ฐ”๊ฟ”์ฃผ๋Š”๊ฑฐ๋‹ค.

๊ทผ๋ฐ .shํŒŒ์ผ ๋‹ค๋ฅธ๊ฒƒ๋„ ๋งŽ๊ณ  ์ด๊ฑด ๊ทธ๋ƒฅ ์ž„์‹œ๋ฐฉํŽธ์ด๋‹ˆ ๋‹ค์‹œ pullํ•˜๋Š”๊ฑธ ์ถ”์ฒœ.

bash
sed -i 's/\\r$//' bochs-2.2.6-build.sh

FF?

VSCode๋กœ ๋ณด๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์ด FF๊ฐ€ ๋“ค์–ด๊ฐ„ ์‹ ๊ธฐํ•œ ๋ฌธ์ž๊ฐ€ ์žˆ๋‹ค.

Blog Image

์ด FF๋Š” Form Feed (์ค„ ๋ฐ”๊ฟˆ ๋ช…๋ น ์ค‘ ํ•˜๋‚˜)

ASCII ์ฝ”๋“œ๋กœ๋Š” 0x0C (๋˜๋Š” ^L) ์ด๊ณ ,

ํ„ฐ๋ฏธ๋„์—์„œ๋Š” ํŽ˜์ด์ง€ ๋„˜๊น€ ์—ญํ• ์„ ํ•˜๋˜ ์˜ˆ์ „ ๋ฌธ์ž


  • ์˜ˆ์ „ ๊ต์žฌ/์—๋””ํ„ฐ์—์„œ ๋ณต๋ถ™ํ•œ ์ฝ”๋“œ
  • ๋ˆ„๊ตฐ๊ฐ€ .c ํŒŒ์ผ์— ^L ๋„ฃ์–ด์„œ ๊ตฌ๋ถ„์ž์ฒ˜๋Ÿผ ์“ฐ๋˜ ์Šต๊ด€
  • ํ•€ํ† ์Šค๋‚˜ ์˜ค๋ž˜๋œ ์œ ๋‹‰์Šค ๊ธฐ๋ฐ˜ ์ฝ”๋“œ์—์„œ ๊ฐ€๋” ๋ณด์ž„.
  • VS Code๊ฐ€ ํŠน๋ณ„ํžˆ ๋ณด์—ฌ์ฃผ๋Š” ๊ฑฐ๊ณ , ์˜ค๋ฅ˜๋Š” ์•„๋‹˜