Revert "INCONSISTENT -- unroot the makefile as much as possible"

This reverts commit fa91e3258543c112745ecb3bcb4e420b46253bc1.
This commit is contained in:
Adrien Bourmault 2019-10-10 11:35:44 +02:00
parent 901efa0390
commit 1427b8ac01
5 changed files with 330 additions and 31 deletions

305
ProjectTree Normal file
View File

@ -0,0 +1,305 @@
#=----------------------------------------------------------------------------=#
# GNU GPL OS/K #
# #
# Desc: #
# #
# #
# Copyright © 2018-2019 The OS/K Team #
# #
# This file is part of OS/K. #
# #
# OS/K is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# any later version. #
# #
# OS/K is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY# without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with OS/K. If not, see <https://www.gnu.org/licenses/>. #
#=----------------------------------------------------------------------------=#
.
├── boot
│   ├── grub
│   │   ├── create_disk.sh
│   │   ├── grub.cfg
│   │   ├── grub-install.sh
│   │   ├── mount.sh
│   │   ├── multiboot.pdf
│   │   └── umount.sh
│   ├── loader
│   │   ├── cpu
│   │   │   ├── cpu32.inc
│   │   │   └── cpu.inc
│   │   ├── io
│   │   │   └── terminal.inc
│   │   ├── mem
│   │   │   ├── management.inc
│   │   │   └── structures.inc
│   │   ├── multiboot
│   │   │   ├── check.inc
│   │   │   └── header.inc
│   │   └── loader.asm
│   └── folder.desc
├── build
│   ├── bin
│   │   ├── disk.img
│   │   └── kaleid
│   ├── obj
│   │   ├── boot
│   │   │   ├── kaleid.x86_64
│   │   │   └── loader.o
│   │   └── kaleid
│   │   ├── kernel
│   │   │   ├── init
│   │   │   │   ├── info.c.229r.expand
│   │   │   │   ├── info.d
│   │   │   │   ├── info.o
│   │   │   │   ├── init.c.229r.expand
│   │   │   │   ├── init.d
│   │   │   │   ├── init.o
│   │   │   │   ├── ssp.c.229r.expand
│   │   │   │   ├── ssp.d
│   │   │   │   ├── ssp.o
│   │   │   │   ├── table.d
│   │   │   │   └── table.o
│   │   │   ├── io
│   │   │   │   ├── ata.c.229r.expand
│   │   │   │   ├── ata.d
│   │   │   │   ├── ata.o
│   │   │   │   ├── cursor.c.229r.expand
│   │   │   │   ├── cursor.d
│   │   │   │   ├── cursor.o
│   │   │   │   ├── keyb.c.229r.expand
│   │   │   │   ├── keyb.d
│   │   │   │   ├── keyb.o
│   │   │   │   ├── spkr.c.229r.expand
│   │   │   │   ├── spkr.d
│   │   │   │   ├── spkr.o
│   │   │   │   ├── vga.c.229r.expand
│   │   │   │   ├── vga.d
│   │   │   │   └── vga.o
│   │   │   ├── ke
│   │   │   │   ├── cpuid.c.229r.expand
│   │   │   │   ├── cpuid.d
│   │   │   │   ├── cpuid.o
│   │   │   │   ├── idt.c.229r.expand
│   │   │   │   ├── idt.d
│   │   │   │   ├── idt.o
│   │   │   │   ├── log.c.229r.expand
│   │   │   │   ├── log.d
│   │   │   │   ├── log.o
│   │   │   │   ├── panic.c.229r.expand
│   │   │   │   ├── panic.d
│   │   │   │   ├── panic.o
│   │   │   │   ├── rtc.c.229r.expand
│   │   │   │   ├── rtc.d
│   │   │   │   └── rtc.o
│   │   │   ├── mm
│   │   │   │   ├── gdt.c.229r.expand
│   │   │   │   ├── gdt.d
│   │   │   │   ├── gdt.o
│   │   │   │   ├── heap.c.229r.expand
│   │   │   │   ├── heap.d
│   │   │   │   ├── heap.o
│   │   │   │   ├── malloc.c.229r.expand
│   │   │   │   ├── malloc.d
│   │   │   │   ├── malloc.o
│   │   │   │   ├── map.c.229r.expand
│   │   │   │   ├── map.d
│   │   │   │   ├── map.o
│   │   │   │   ├── paging.c.229r.expand
│   │   │   │   ├── paging.d
│   │   │   │   └── paging.o
│   │   │   ├── po
│   │   │   │   ├── shtdwn.c.229r.expand
│   │   │   │   ├── shtdwn.d
│   │   │   │   └── shtdwn.o
│   │   │   ├── ps
│   │   │   │   ├── sched.d
│   │   │   │   └── sched.o
│   │   │   └── sh
│   │   │   ├── argv.c.229r.expand
│   │   │   ├── argv.d
│   │   │   ├── argv.o
│   │   │   ├── musage.c.229r.expand
│   │   │   ├── musage.d
│   │   │   ├── musage.o
│   │   │   ├── shcmds.c.229r.expand
│   │   │   ├── shcmds.d
│   │   │   ├── shcmds.o
│   │   │   ├── shell.c.229r.expand
│   │   │   ├── shell.d
│   │   │   └── shell.o
│   │   ├── libbuf
│   │   │   ├── bclose.c.229r.expand
│   │   │   ├── bclose.d
│   │   │   ├── bclose.o
│   │   │   ├── bflush.c.229r.expand
│   │   │   ├── bflush.d
│   │   │   ├── bflush.o
│   │   │   ├── bgetc.c.229r.expand
│   │   │   ├── bgetc.d
│   │   │   ├── bgetc.o
│   │   │   ├── bmisc.c.229r.expand
│   │   │   ├── bmisc.d
│   │   │   ├── bmisc.o
│   │   │   ├── bopen.c.229r.expand
│   │   │   ├── bopen.d
│   │   │   ├── bopen.o
│   │   │   ├── bprint.c.229r.expand
│   │   │   ├── bprint.d
│   │   │   ├── bprint.o
│   │   │   ├── bputc.c.229r.expand
│   │   │   ├── bputc.d
│   │   │   ├── bputc.o
│   │   │   ├── bread.d
│   │   │   ├── bread.o
│   │   │   ├── bscan.d
│   │   │   ├── bscan.o
│   │   │   ├── bscroll.c.229r.expand
│   │   │   ├── bscroll.d
│   │   │   ├── bscroll.o
│   │   │   ├── bwrite.d
│   │   │   └── bwrite.o
│   │   └── libc
│   │   ├── atoi.c.229r.expand
│   │   ├── atoi.o
│   │   ├── ctype.c.229r.expand
│   │   ├── ctype.d
│   │   ├── ctype.o
│   │   ├── errno.c.229r.expand
│   │   ├── errno.d
│   │   ├── errno.o
│   │   ├── itoa.c.229r.expand
│   │   ├── itoa.o
│   │   ├── mem.c.229r.expand
│   │   ├── mem.d
│   │   ├── mem.o
│   │   ├── rand.c.229r.expand
│   │   ├── rand.d
│   │   ├── rand.o
│   │   ├── sprintf.c.229r.expand
│   │   ├── sprintf.d
│   │   ├── sprintf.o
│   │   ├── string.c.229r.expand
│   │   ├── string.d
│   │   ├── string.o
│   │   ├── strtol.c.229r.expand
│   │   ├── strtol.d
│   │   └── strtol.o
│   ├── grub.log
│   └── kernel.ld
├── include
│   ├── ex
│   │   ├── lock.h
│   │   └── malloc.h
│   ├── init
│   │   ├── boot.h
│   │   └── mboot.h
│   ├── io
│   │   ├── ata.h
│   │   ├── cursor.h
│   │   ├── keyb.h
│   │   ├── spkr.h
│   │   └── vga.h
│   ├── ke
│   │   ├── cpuid.h
│   │   ├── idt.h
│   │   ├── proc.h
│   │   ├── sched.h
│   │   ├── spinlock.h
│   │   └── time.h
│   ├── lib
│   │   ├── buf.h
│   │   └── list.h
│   ├── mm
│   │   ├── heap.h
│   │   ├── malloc.h
│   │   └── mm.h
│   ├── po
│   │   └── shtdwn.h
│   ├── sh
│   │   ├── argv.h
│   │   └── shell.h
│   ├── asm.h
│   ├── errno.h
│   ├── kernel.h
│   ├── libc.h
│   └── vers.h
├── kaleid
│   ├── kernel
│   │   ├── init
│   │   │   ├── info.c
│   │   │   ├── init.c
│   │   │   ├── ssp.c
│   │   │   └── table.c
│   │   ├── io
│   │   │   ├── ata.asm
│   │   │   ├── ata.c
│   │   │   ├── cursor.c
│   │   │   ├── keyb.c
│   │   │   ├── spkr.c
│   │   │   └── vga.c
│   │   ├── ke
│   │   │   ├── cpuf.asm
│   │   │   ├── cpuf.inc
│   │   │   ├── cpuid.c
│   │   │   ├── idt.c
│   │   │   ├── isr.asm
│   │   │   ├── log.c
│   │   │   ├── panic.c
│   │   │   └── rtc.c
│   │   ├── mm
│   │   │   ├── gdt.asm
│   │   │   ├── gdt.c
│   │   │   ├── heap.c
│   │   │   ├── malloc.c
│   │   │   ├── map.c
│   │   │   ├── paging.asm
│   │   │   └── paging.c
│   │   ├── po
│   │   │   └── shtdwn.c
│   │   ├── ps
│   │   │   └── sched.c
│   │   └── sh
│   │   ├── argv.c
│   │   ├── musage.c
│   │   ├── shcmds.c
│   │   ├── shell.c
│   │   └── shell.h
│   ├── libbuf
│   │   ├── bclose.c
│   │   ├── bflush.c
│   │   ├── bgetc.c
│   │   ├── bmisc.c
│   │   ├── bopen.c
│   │   ├── bprint.c
│   │   ├── bputc.c
│   │   ├── bread.c
│   │   ├── bscan.c
│   │   ├── bscroll.c
│   │   └── bwrite.c
│   └── libc
│   ├── atoi.c
│   ├── ctype.c
│   ├── errno.c
│   ├── itoa.c
│   ├── mem.c
│   ├── rand.c
│   ├── sprintf.c
│   ├── string.c
│   └── strtol.c
├── AUTHORS
├── ChangeLog
├── COPYING
├── Makefile
├── ProjectTree
└── README.md
42 directories, 235 files

View File

@ -36,7 +36,7 @@ dd if=/dev/zero of=$1 bs=512 count=131072 status=progress
echo ${CL2}[create_disk.sh]${NC} Partitionning image... \(fdisk\)${CL3}
## Partition the image
# WARNING, DO NOT DELETE SPACES !
/sbin/fdisk $1 > /dev/null <<EEOF
sudo fdisk $1 > /dev/null <<EEOF
n
p
1
@ -47,21 +47,19 @@ w
EEOF
# WARNING, YOU CAN NOW DELETE SPACES
echo ${CL2}[create_disk.sh]${NC} Mouting image... \(losetup\)${CL3}
## Map
echo ${CL2}[create_disk.sh]${NC} Mouting image... \(udisksctl\)${CL3}
ret=$(udisksctl loop-setup --no-user-interaction -f $1 -o 1048576) #mounting the logical partition
set -- $ret
echo "Mounted at ${5%?}"
MOUNTPOINT=${5%?}
sudo losetup -D > /dev/null
sudo losetup /dev/loop0 $1 -o 1048576 > /dev/null #mounting the logical partition
echo ${CL2}[create_disk.sh]${NC} Formatting image... \(mkdosfs\)${CL3}
## Format
echo ${CL2}[create_disk.sh]${NC} Formatting image AS ROOT... \(mkdosfs\)${CL3}
sudo mkdosfs -F32 -f 2 ${MOUNTPOINT}
sudo mkdosfs -F32 -f 2 /dev/loop0 > /dev/null
echo ${CL2}[create_disk.sh]${NC} Sync image... \(sync\)${CL3}
sync
sync
echo ${CL2}[create_disk.sh]${NC} Unmounting... \(udisksctl\)${CL3}
udisksctl unmount --no-user-interaction -f -b ${MOUNTPOINT}
echo ${CL2}[create_disk.sh]${CL} Terminated without error.${CL3}
echo ${CL2}[create_disk.sh]${NC} Unmounting... \(losetup\)${CL3}
sudo losetup -D > /dev/null
echo ${CL2}[create_disk.sh]${CL} Terminated without error.${CL3}

View File

@ -32,10 +32,9 @@ set -e #exit if error
echo ${CL2}[grub-install.sh]${NC} Mouting image... \(losetup\)${CL3}
## Prepare Mount
ret=$(udisksctl loop-setup --no-user-interaction -f $1) #mounting the logical partition
set -- $ret
echo "Mounted at ${5%?}"
MOUNTPOINT=${5%?}
sudo losetup -D > /dev/null
sudo losetup /dev/loop0 $1 > /dev/null # mounting the device block
sudo losetup /dev/loop1 $1 -o 1048576 > /dev/null #mounting the logical partition
echo ${CL2}[grub-install.sh]${NC} Mounting volume... \(mount\)${CL3}
## Mount
@ -62,4 +61,4 @@ sudo umount /dev/loop1 > /dev/null
echo ${CL2}[grub-install.sh]${NC} Unmounting image... \(losetup\)${CL3}
sudo losetup -D > /dev/null
echo ${CL2}[grub-install.sh]${CL} See grub.log for more informations.${CL3}
echo ${CL2}[grub-install.sh]${CL} See grub.log for more informations.${CL3}

View File

@ -31,13 +31,8 @@ NC='\033[1;37m'
set -e #exit if error
echo ${CL2}[mount.sh]${NC} Mouting image... \(losetup\)${CL3}
ret=$(udisksctl loop-setup --no-user-interaction -f $1) #mounting the logical partition
set -- $ret
echo "Mounted at ${5%?}"
MOUNTPOINT=${5%?}
ret=$(mount | grep $MOUNTPOINT)
set -- $ret
echo "Mounted at ${3%?}"
MOUNTPATH=${3%?}
echo ${CL2}[mount.sh]${CL} Terminated without error.${CL3}
sudo losetup -D > /dev/null
sudo losetup /dev/loop0 $1 -o 1048576 > /dev/null #mounting the logical partition
echo ${CL2}[mount.sh]${NC} Mouting volume... \(mount\)${CL3}
sudo mount -t vfat /dev/loop0 $2 -o rw,uid=$(id -u),gid=$(id -g) > /dev/null
echo ${CL2}[mount.sh]${CL} Terminated without error.${CL3}

View File

@ -30,7 +30,9 @@ NC='\033[1;37m'
set -e #exit if error
sync
sync
echo ${CL2}[umount.sh]${NC} Unmounting volume and image... \(udisksctl\)${CL3}
udisksctl unmount --no-user-interaction -f -b $1
echo ${CL2}[umount.sh]${CL} Terminated without error.${CL3}
sleep 1
echo ${CL2}[umount.sh]${NC} Unmounting volume... \(umount\)${CL3}
sudo umount $1
echo ${CL2}[umount.sh]${NC} Unmounting image... \(losetup\)${CL3}
sudo losetup -D
echo ${CL2}[umount.sh]${CL} Terminated without error.${CL3}