Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/mosPublic

Commitb203f33

Browse files
committed
Update install instructions
1 parentfaf25e0 commitb203f33

File tree

6 files changed

+28
-23
lines changed

6 files changed

+28
-23
lines changed

‎README.md‎

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,16 @@ mOS is the unix-like operating system developed from scratch and aims to POSIX c
6969

7070
**Ubuntu**
7171

72+
- Install packakges
73+
```bash
74+
$ sudo apt install build-essential autopoint bison gperf texi2html texinfo qemu automake-1.15 nasm xorriso qemu-system-i386
75+
```
76+
7277
- Install gcc cross compilier viahttps://wiki.osdev.org/GCC_Cross-Compiler#The_Build
7378

7479
- Install GCC (Version 9.1.0) & Binutils (Version 2.32).
7580

7681
- Open src/toolchain/build.sh and modify SYSROOT and PREFIX variables to fit in your case
77-
7882
```
7983
PREFIX="$HOME/opt/cross"
8084
TARGET=i386-pc-mos
@@ -84,19 +88,18 @@ mOS is the unix-like operating system developed from scratch and aims to POSIX c
8488
```
8589

8690
- Install mos toolchain
87-
8891
```
8992
$ cd src/toolchain
90-
$ ./build
93+
$ ./build.sh
9194
```
9295

9396
- Run Emulator
94-
9597
```
9698
$ cd src && mkdir logs
9799
$ ./create_image.sh
98-
$ cd src/ports/bash && ./package.sh
99-
$ cd src/ports/coreutils && ./package.sh
100+
$ cd ports/figlet && ./package.sh && cd ../..
101+
$ cd ports/bash && ./package.sh make && cd ../..
102+
$ cd ports/coreutils && ./package.sh make && cd ../..
100103
$ ./build.sh qemu iso
101104
```
102105

@@ -110,13 +113,12 @@ mOS is the unix-like operating system developed from scratch and aims to POSIX c
110113
```
111114

112115
✍️ To get userspace address for debugging
113-
114-
```
115-
$ i386-mos-readelf -e program
116-
# find the line below and copy Addr
117-
# [Nr] Name Type Addr Off Size ES Flg Lk Inf Al
118-
# [ x] .text PROGBITS xxx xxx xxx 00 AX 0 0 4
119-
```
116+
```
117+
$ i386-mos-readelf -e program
118+
# find the line below and copy Addr
119+
# [Nr] Name Type Addr Off Size ES Flg Lk Inf Al
120+
# [ x] .text PROGBITS xxx xxx xxx 00 AX 0 0 4
121+
```
120122

121123
**Unit Test**
122124

‎src/create_image.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ if [[ "$unamestr" == 'Linux' ]]; then
3737
cd ../..
3838
cd apps/calculator&& make clean&& make
3939
cd ../..
40-
cd apps/ld&& rm -f ld&& i386-mos-gcc -g ld.c -o ld
40+
cd apps/ld&& rm -f ld&& i386-pc-mos-gcc -g ld.c -o ld
4141
cd ../..
4242

4343
fordirin apps/cmd/*
4444
do
4545
[-d"$dir" ]||continue
4646
name=$(basename$dir)
4747
rm -f$dir/$name
48-
i386-mos-gcc -g$dir/$name.c -o$dir/$name
48+
i386-pc-mos-gcc -g$dir/$name.c -o$dir/$name
4949
sudo cp$dir/$name"/mnt/${DISK_NAME}/bin"
5050
done
5151

‎src/libraries/libc/Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ HEADERS = $(wildcard *.h **/*.h)
77
# Nice syntax for file extension replacement
88
LIBC_OBJ = ${A_SOURCES:.S=.o} ${C_SOURCES:.c=.o}
99

10-
CC = i386-mos-gcc
11-
AR = i386-mos-ar
10+
CC = i386-pc-mos-gcc
11+
AR = i386-pc-mos-ar
1212

1313
# -g: Use debugging symbols in gcc
1414
CFLAGS= -g -std=gnu99 -Wall -Wextra -Wno-unused-parameter -Wno-discarded-qualifiers -Wno-comment -Wno-multichar -Wno-sequence-point -Wno-switch -Wno-unused-function -Wno-unused-value -Wno-sign-compare -Wno-implicit-fallthrough

‎src/ports/coreutils/package.sh‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ then
2222

2323
cd gnulib
2424
patch -p1<$CURRENT_DIR/gnulib.patch
25+
cd ..
26+
27+
# cross-compiling has the issue of missing primes.h -> we use native tool to generate primes.h
28+
./configure ac_cv_header_sys_cdefs_h=yes ac_cv_header_sys_sysctl_h=xyes
29+
make -j4 CFLAGS="-Wno-error=suggest-attribute=const -Wno-error=stringop-overflow"
30+
make distclean
2531

2632
# ports/coreutils
2733
cd$CURRENT_DIR
2834
rm -rf build-coreutils&& mkdir build-coreutils&&cd build-coreutils
29-
30-
# cross-compiling has the issue of missing primes.h -> we use native tool to generate primes.h
31-
$COREUTILS_DIR/configure ac_cv_header_sys_cdefs_h=yes
32-
make -j4 CFLAGS="-Wno-error=suggest-attribute=const"
3335
fi
3436

3537
# ports/coreutils

‎src/ports/figlet/package.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cd figlet-2.2.5
1515
patch -p1< ../figlet-2.2.5.patch
1616

1717
make clean
18-
make CC=i386-mos-gcc LD=i386-mos-gcc
18+
make CC=i386-pc-mos-gcc LD=i386-pc-mos-gcc
1919

2020
sudo mkdir"/mnt/${DISK_NAME}"
2121
sudo mount -o loop ../../../hdd.img"/mnt/${DISK_NAME}"

‎src/toolchain/build.sh‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -Eeuo pipefail
33

44
PREFIX="$HOME/opt/cross"
5-
TARGET=i386-mos
5+
TARGET=i386-pc-mos
66
# SYSROOT cannot locate inside PREFIX
77
SYSROOT="$HOME/Projects/mos/src/toolchain/sysroot"
88
JOBCOUNT=$(nproc)
@@ -49,6 +49,7 @@ gcc_fetch() {
4949
gcc_build() {
5050
cd gcc-9.1.0
5151
patch -p1< ../gcc-9.1.0.patch
52+
./contrib/download_prerequisites
5253
cd ..&& mkdir build-gcc
5354
cd build-gcc
5455
../gcc-9.1.0/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot=$SYSROOT --enable-languages=c,c++

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp