Skip to content

Commit

Permalink
Reorganizar repo
Browse files Browse the repository at this point in the history
  • Loading branch information
hialvaro committed Nov 11, 2021
1 parent 36fe088 commit d0c7a6a
Show file tree
Hide file tree
Showing 299 changed files with 23,222 additions and 16 deletions.
22 changes: 22 additions & 0 deletions Examens/Altres_Solucions/copia-a-direccion-memoria/.bochsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#romimage: file=$BXSHARE/BIOS-bochs-latest
#vgaromimage: file=$BXSHARE/VGABIOS-elpin-2.40
megs: 16

floppya: 1_44=./zeos.bin, status=inserted
boot: floppy
floppy_bootsig_check: disabled=0

log: bochsout.txt
panic: action=ask
error: action=report
info: action=report
debug: action=ignore
debugger_log: -

#vga_update_interval: 300000
#keyboard_serial_delay: 250
#keyboard_paste_delay: 100000
#mouse: enabled=0
#private_colormap: enabled=0
#keyboard_mapping: enabled=0, map=

23 changes: 23 additions & 0 deletions Examens/Altres_Solucions/copia-a-direccion-memoria/.bochsrc_gdb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#romimage: file=$BXSHARE/BIOS-bochs-latest
#vgaromimage: file=$BXSHARE/VGABIOS-elpin-2.40
megs: 16

floppya: 1_44=./zeos.bin, status=inserted
boot: floppy
floppy_bootsig_check: disabled=0

log: bochsout.txt
panic: action=ask
error: action=report
info: action=report
debug: action=ignore
debugger_log: -

#vga_update_interval: 300000
#keyboard_serial_delay: 250
#keyboard_paste_delay: 100000
#mouse: enabled=0
#private_colormap: enabled=0
#keyboard_mapping: enabled=0, map=

gdbstub: enabled=1, port=1234, text_base=0, data_base=0, bss_base=0
22 changes: 22 additions & 0 deletions Examens/Altres_Solucions/copia-a-direccion-memoria/.gdbcmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

define pila
x $esp
x $esp+4
x $esp+8
x $esp+12
x $esp+16
x $esp+20
x $esp+24
x $esp+28
x $esp+32
x $esp+36
x $esp+40
end

define print-stack
pila
end

target remote localhost:1234
display/i $eip
add-symbol-file user 0x00100010
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

define pila
x $esp
x $esp+4
x $esp+8
x $esp+12
x $esp+16
x $esp+20
x $esp+24
x $esp+28
x $esp+32
x $esp+36
x $esp+40
end

define print-stack
pila
end

target remote localhost:1234
display/i $eip
add-symbol-file user XXXXXX
110 changes: 110 additions & 0 deletions Examens/Altres_Solucions/copia-a-direccion-memoria/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
################################
##############ZeOS #############
################################
########## Makefile ############
################################

# package dev86 is required
AS86 = as86 -0 -a
LD86 = ld86 -0

HOSTCFLAGS = -Wall -Wstrict-prototypes -g
HOSTCC = gcc
CC = gcc -m32
AS = as --32
LD = ld -melf_i386
OBJCOPY = objcopy -O binary -R .note -R .comment -S

INCLUDEDIR = include

# Define here flags to compile the tests if needed
JP =

CFLAGS = -O2 -g $(JP) -fno-omit-frame-pointer -ffreestanding -Wall -I$(INCLUDEDIR)
ASMFLAGS = -I$(INCLUDEDIR)
SYSLDFLAGS = -T system.lds
USRLDFLAGS = -T user.lds
LINKFLAGS = -g

SYSOBJ = interrupt.o entry.o sys_call_table.o io.o sched.o sys.o mm.o devices.o utils.o hardware.o list.o p_stats.o kernel-utils.o

LIBZEOS = -L . -l zeos -l auxjp

#add to USROBJ the object files required to complete the user program
USROBJ = libc.o user-utils.o # libjp.a

all:zeos.bin

zeos.bin: bootsect system build user
$(OBJCOPY) system system.out
$(OBJCOPY) user user.out
./build bootsect system.out user.out > zeos.bin

build: build.c
$(HOSTCC) $(HOSTCFLAGS) -o $@ $<

bootsect: bootsect.o
$(LD86) -s -o $@ $<

bootsect.o: bootsect.s
$(AS86) -o $@ $<

bootsect.s: bootsect.S Makefile
$(CPP) $(ASMFLAGS) -traditional $< -o $@

entry.s: entry.S $(INCLUDEDIR)/asm.h $(INCLUDEDIR)/segment.h
$(CPP) $(ASMFLAGS) -o $@ $<

user-utils.s: user-utils.S $(INCLUDEDIR)/asm.h
$(CPP) $(ASMFLAGS) -o $@ $<

kernel-utils.s: kernel-utils.S $(INCLUDEDIR)/asm.h
$(CPP) $(ASMFLAGS) -o $@ $<

sys_call_table.s: sys_call_table.S $(INCLUDEDIR)/asm.h $(INCLUDEDIR)/segment.h
$(CPP) $(ASMFLAGS) -o $@ $<

user.o:user.c $(INCLUDEDIR)/libc.h

interrupt.o:interrupt.c $(INCLUDEDIR)/interrupt.h $(INCLUDEDIR)/segment.h $(INCLUDEDIR)/types.h

io.o:io.c $(INCLUDEDIR)/io.h

sched.o:sched.c $(INCLUDEDIR)/sched.h

libc.o:libc.c $(INCLUDEDIR)/libc.h

mm.o:mm.c $(INCLUDEDIR)/types.h $(INCLUDEDIR)/mm.h

sys.o:sys.c $(INCLUDEDIR)/devices.h

utils.o:utils.c $(INCLUDEDIR)/utils.h

p_stats.o:p_stats.c $(INCLUDEDIR)/utils.h

system.o:system.c $(INCLUDEDIR)/hardware.h system.lds $(SYSOBJ) $(INCLUDEDIR)/segment.h $(INCLUDEDIR)/types.h $(INCLUDEDIR)/interrupt.h $(INCLUDEDIR)/system.h $(INCLUDEDIR)/sched.h $(INCLUDEDIR)/mm.h $(INCLUDEDIR)/io.h $(INCLUDEDIR)/mm_address.h


system: system.o system.lds $(SYSOBJ)
$(LD) $(LINKFLAGS) $(SYSLDFLAGS) -o $@ $< $(SYSOBJ) $(LIBZEOS)

user: user.o user.lds $(USROBJ)
$(LD) $(LINKFLAGS) $(USRLDFLAGS) -o $@ $< $(USROBJ)


clean:
rm -f *.o *.s bochsout.txt parport.out system.out system bootsect zeos.bin user user.out *~ build

disk: zeos.bin
dd if=zeos.bin of=/dev/fd0

emul: zeos.bin
bochs -q -f .bochsrc

gdb: zeos.bin
bochs -q -f .bochsrc_gdb &
./generate_gdbcmd_file.sh
gdb -x .gdbcmd system

emuldbg: zeos.bin
bochs_nogdb -q -f .bochsrc
Loading

0 comments on commit d0c7a6a

Please sign in to comment.