Add files via upload
Esse commit está contido em:
BIN
Arquivo binário não exibido.
@@ -68,6 +68,9 @@ boot/boot: boot/boot.s tools/system
|
||||
$(AS86) -o boot/boot.o tmp.s
|
||||
rm -f tmp.s
|
||||
$(LD86) -s -o boot/boot boot/boot.o
|
||||
|
||||
run:
|
||||
qemu-system-i386 -drive format=raw,file=Image,index=0,if=floppy -boot a -hdb hd_oldlinux.img -m 8 -machine pc-0.10
|
||||
|
||||
clean:
|
||||
rm -f Image System.map tmp_make boot/boot core
|
||||
@@ -96,3 +99,4 @@ init/main.o : init/main.c include/unistd.h include/sys/stat.h \
|
||||
include/linux/sched.h include/linux/head.h include/linux/fs.h \
|
||||
include/linux/mm.h include/asm/system.h include/asm/io.h include/stddef.h \
|
||||
include/stdarg.h include/fcntl.h
|
||||
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
First of all, thanks Mariuz!
|
||||
|
||||
After a lot of time, I managed to compile this revised version of the
|
||||
first kernel on machines with Ubuntu 18.04 64 and 32 bit versions. So you can compile them and try them on 64 and 32 bit Intel machines.
|
||||
|
||||
I also attach files produced by make that seem to have a lot of warnings when compiling, but the kernel runs in both emulators: QEMU ver. 2.11.1 and Bochs ver 2.6. and that was a great success for me ...
|
||||
|
||||
I also uploaded the bochsrc.txt file so that the bochs runs from the command line from the root where the kernel is and qemu runs from the cmd line by the command make run
|
||||
|
||||
The error I noticed after booting the system is that the application
|
||||
vim (if you try) has a problem with opening files.
|
||||
I will try to fix this.
|
||||
|
||||
Enjoy work and improvement
|
||||
sincerely Isoux
|
||||
@@ -0,0 +1,46 @@
|
||||
# configuration file generated by Bochs
|
||||
plugin_ctrl: unmapped=1, biosdev=1, speaker=1, extfpuirq=1, parallel=1, serial=1, gameport=1, iodebug=1
|
||||
config_interface: textconfig
|
||||
display_library: x, options="gui_debug"
|
||||
memory: host=32, guest=32
|
||||
romimage: file="/usr/share/bochs/BIOS-bochs-latest"
|
||||
vgaromimage: file="/usr/share/bochs/VGABIOS-lgpl-latest"
|
||||
boot: floppy
|
||||
floppy_bootsig_check: disabled=0
|
||||
floppya: type=1_44, 1_44="Image", status=inserted, write_protected=0
|
||||
# no floppyb
|
||||
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
|
||||
ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15
|
||||
ata2: enabled=0
|
||||
ata3: enabled=0
|
||||
ata0-slave: type=disk, path="hd_oldlinux.img", mode=flat, cylinders=1024, heads=4, spt=20, translation=none
|
||||
pci: enabled=1, chipset=i440fx
|
||||
vga: extension=vbe, update_freq=5
|
||||
cpu: count=1, ips=4000000, model=bx_generic, reset_on_triple_fault=1, cpuid_limit_winnt=0, ignore_bad_msrs=1, mwait_is_nop=0
|
||||
cpuid: family=6, model=0x03, stepping=3, mmx=1, apic=xapic, sse=sse2, sse4a=0, sep=1, aes=0, xsave=0, xsaveopt=0, movbe=0, adx=0, smep=0, avx=0, avx_f16c=0, avx_fma=0, bmi=0, xop=0, tbm=0, fma4=0, vmx=1, x86_64=1, 1g_pages=0, pcid=0, fsgsbase=0, mwait=1
|
||||
cpuid: vendor_string="GenuineIntel"
|
||||
cpuid: brand_string=" Intel(R) Pentium(R) 4 CPU "
|
||||
|
||||
print_timestamps: enabled=0
|
||||
debugger_log: -
|
||||
magic_break: enabled=0
|
||||
port_e9_hack: enabled=0
|
||||
private_colormap: enabled=0
|
||||
clock: sync=none, time0=local, rtc_sync=0
|
||||
# no cmosimage
|
||||
# no loader
|
||||
log: -
|
||||
logprefix: %t%e%d
|
||||
panic: action=ask
|
||||
error: action=report
|
||||
info: action=report
|
||||
debug: action=ignore
|
||||
keyboard: type=mf, serial_delay=250, paste_delay=100000, keymap=
|
||||
user_shortcut: keys=none
|
||||
mouse: enabled=0, type=ps2, toggle=ctrl+mbutton
|
||||
parport1: enabled=1, file=""
|
||||
parport2: enabled=0
|
||||
com1: enabled=1, mode=null, dev=""
|
||||
com2: enabled=0
|
||||
com3: enabled=0
|
||||
com4: enabled=0
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
as --32 --32 -o boot/head.o boot/head.s
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -fno-stack-protector -fno-builtin -g -m32 \
|
||||
-nostdinc -Iinclude -c -o init/main.o init/main.c
|
||||
(cd kernel; make)
|
||||
make[1]: Entering directory '/home/makisa/Downloads/LINUX-0.01/linux-0.01-master/kernel'
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o sched.o sched.c
|
||||
as --32 -o system_call.o system_call.s
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o traps.o traps.c
|
||||
as --32 -o asm.o asm.s
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o fork.o fork.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o panic.o panic.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o printk.o printk.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o vsprintf.o vsprintf.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o tty_io.o tty_io.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o console.o console.c
|
||||
as --32 -o keyboard.o keyboard.s
|
||||
as --32 -o rs_io.o rs_io.s
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o hd.o hd.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o sys.o sys.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o exit.o exit.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o serial.o serial.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o mktime.o mktime.c
|
||||
ld -m elf_i386 -r -o kernel.o sched.o system_call.o traps.o asm.o fork.o panic.o printk.o vsprintf.o tty_io.o console.o keyboard.o rs_io.o hd.o sys.o exit.o serial.o mktime.o
|
||||
sync
|
||||
make[1]: Leaving directory '/home/makisa/Downloads/LINUX-0.01/linux-0.01-master/kernel'
|
||||
(cd mm; make)
|
||||
make[1]: Entering directory '/home/makisa/Downloads/LINUX-0.01/linux-0.01-master/mm'
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -finline-functions -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o memory.o memory.c
|
||||
as --32 -o page.o page.s
|
||||
ld -m elf_i386 -r -o mm.o memory.o page.o
|
||||
make[1]: Leaving directory '/home/makisa/Downloads/LINUX-0.01/linux-0.01-master/mm'
|
||||
(cd fs; make)
|
||||
make[1]: Entering directory '/home/makisa/Downloads/LINUX-0.01/linux-0.01-master/fs'
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o open.o open.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o read_write.o read_write.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o inode.o inode.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o file_table.o file_table.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o buffer.o buffer.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o super.o super.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o block_dev.o block_dev.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o char_dev.o char_dev.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o file_dev.o file_dev.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o stat.o stat.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o exec.o exec.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o pipe.o pipe.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o namei.o namei.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o bitmap.o bitmap.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o fcntl.o fcntl.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o ioctl.o ioctl.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o tty_ioctl.o tty_ioctl.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o truncate.o truncate.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o sys_getdents.o sys_getdents.c
|
||||
ld -m elf_i386 -r -o fs.o open.o read_write.o inode.o file_table.o buffer.o super.o block_dev.o char_dev.o file_dev.o stat.o exec.o pipe.o namei.o bitmap.o fcntl.o ioctl.o tty_ioctl.o truncate.o sys_getdents.o
|
||||
make[1]: Leaving directory '/home/makisa/Downloads/LINUX-0.01/linux-0.01-master/fs'
|
||||
(cd lib; make)
|
||||
make[1]: Entering directory '/home/makisa/Downloads/LINUX-0.01/linux-0.01-master/lib'
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o ctype.o ctype.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o _exit.o _exit.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o open.o open.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o close.o close.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o errno.o errno.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o write.o write.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o dup.o dup.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o setsid.o setsid.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o execve.o execve.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o wait.o wait.c
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -m32 -finline-functions -fno-stack-protector -nostdinc -fno-builtin -g -I../include \
|
||||
-c -o string.o string.c
|
||||
ar rcs lib.a ctype.o _exit.o open.o close.o errno.o write.o dup.o setsid.o execve.o wait.o string.o
|
||||
sync
|
||||
make[1]: Leaving directory '/home/makisa/Downloads/LINUX-0.01/linux-0.01-master/lib'
|
||||
ld -m elf_i386 -M -Ttext 0 -e startup_32 boot/head.o init/main.o \
|
||||
kernel/kernel.o mm/mm.o fs/fs.o \
|
||||
lib/lib.a \
|
||||
-o tools/system > System.map
|
||||
(echo -n "SYSSIZE = (";stat -c%s tools/system \
|
||||
| tr '\012' ' '; echo "+ 15 ) / 16") > tmp.s
|
||||
cat boot/boot.s >> tmp.s
|
||||
as86 -0 -o boot/boot.o tmp.s
|
||||
00286 /*
|
||||
00287 * This procedure turns off the floppy drive motor, so
|
||||
00288 * that we enter the kernel in a known state, and
|
||||
00289 * don't have to worry about it later.
|
||||
00290 */
|
||||
00286 /*
|
||||
00287 * This procedure turns off the floppy drive motor, so
|
||||
00288 * that we enter the kernel in a known state, and
|
||||
00289 * don't have to worry about it later.
|
||||
00290 */
|
||||
rm -f tmp.s
|
||||
ld86 -0 -s -o boot/boot boot/boot.o
|
||||
gcc -Wall -O -std=gnu89 -fstrength-reduce -fomit-frame-pointer -fno-stack-protector -fno-builtin -g -m32 \
|
||||
-o tools/build tools/build.c
|
||||
#chmem +65000 tools/build
|
||||
objcopy -O binary -R .note -R .comment tools/system tools/system.bin
|
||||
tools/build boot/boot tools/system.bin > Image
|
||||
@@ -0,0 +1,45 @@
|
||||
fork.c: In function ‘copy_process’:
|
||||
fork.c:76:2: warning: implicit declaration of function ‘memcpy’ [-Wimplicit-function-declaration]
|
||||
memcpy(p, current, sizeof(struct task_struct));
|
||||
^~~~~~
|
||||
vsprintf.c: In function ‘vsprintf’:
|
||||
vsprintf.c:101:6: warning: variable ‘qualifier’ set but not used [-Wunused-but-set-variable]
|
||||
int qualifier; /* 'h', 'l', or 'L' for integer fields */
|
||||
^~~~~~~~~
|
||||
sys_getdents.c: In function ‘minix_getdents’:
|
||||
sys_getdents.c:44:28: warning: pointer targets in passing argument 2 of ‘put_fs_long’ differ in signedness [-Wpointer-sign]
|
||||
put_fs_long(de->inode,&dirent->d_ino);
|
||||
^
|
||||
In file included from sys_getdents.c:8:0:
|
||||
../include/asm/segment.h:35:20: note: expected ‘long unsigned int *’ but argument is of type ‘long int *’
|
||||
extern inline void put_fs_long(unsigned long val,unsigned long * addr)
|
||||
^~~~~~~~~~~
|
||||
sys_getdents.c:46:20: warning: pointer targets in passing argument 2 of ‘put_fs_word’ differ in signedness [-Wpointer-sign]
|
||||
put_fs_word(i,&dirent->d_reclen);
|
||||
^
|
||||
In file included from sys_getdents.c:8:0:
|
||||
../include/asm/segment.h:30:20: note: expected ‘short int *’ but argument is of type ‘short unsigned int *’
|
||||
extern inline void put_fs_word(short val,short * addr)
|
||||
^~~~~~~~~~~
|
||||
sys_getdents.c: In function ‘minix_getdents64’:
|
||||
sys_getdents.c:88:28: warning: passing argument 2 of ‘put_fs_long’ from incompatible pointer type [-Wincompatible-pointer-types]
|
||||
put_fs_long(de->inode,&dirent->d_ino);
|
||||
^
|
||||
In file included from sys_getdents.c:8:0:
|
||||
../include/asm/segment.h:35:20: note: expected ‘long unsigned int *’ but argument is of type ‘uint64_t * {aka long long unsigned int *}’
|
||||
extern inline void put_fs_long(unsigned long val,unsigned long * addr)
|
||||
^~~~~~~~~~~
|
||||
sys_getdents.c:90:20: warning: pointer targets in passing argument 2 of ‘put_fs_word’ differ in signedness [-Wpointer-sign]
|
||||
put_fs_word(i,&dirent->d_reclen);
|
||||
^
|
||||
In file included from sys_getdents.c:8:0:
|
||||
../include/asm/segment.h:30:20: note: expected ‘short int *’ but argument is of type ‘uint16_t * {aka short unsigned int *}’
|
||||
extern inline void put_fs_word(short val,short * addr)
|
||||
^~~~~~~~~~~
|
||||
tools/build.c: In function ‘main’:
|
||||
tools/build.c:71:2: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
|
||||
write(1,buf,512);
|
||||
^~~~~~~~~~~~~~~~
|
||||
Boot sector 452 bytes.
|
||||
System 106113 bytes.
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário