summaryrefslogtreecommitdiff
path: root/userspace
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-11-22 15:46:24 +0100
committerMichal Idziorek <m.i@gmx.at>2014-11-22 15:46:24 +0100
commit795b1f7df203ae33e1d0eb13612f0ba2abf4351e (patch)
tree42c4d8f94b6e7a9815ea5b3fe52a251d004d4b87 /userspace
parent4ef54112ec3d3772cb97984a26c85299b8065316 (diff)
fix / workaround for my ELF binaries
Diffstat (limited to 'userspace')
-rw-r--r--userspace/Makefile6
-rw-r--r--userspace/linker.ld28
2 files changed, 32 insertions, 2 deletions
diff --git a/userspace/Makefile b/userspace/Makefile
index 0797db2..a0817e3 100644
--- a/userspace/Makefile
+++ b/userspace/Makefile
@@ -1,9 +1,11 @@
CC=i686-foolos-gcc
+CFLAGS=-w
+LDFLAGS=-T linker.ld
PROGS=shell simple brainfuck add
ext2.img: $(PROGS)
- dd if=/dev/zero of=ext2.img bs=512 count=2000
+ dd if=/dev/zero of=ext2.img bs=512 count=5000
sudo mkfs.ext2 -O none ext2.img -F
mkdir mnt
sudo mount ext2.img mnt
@@ -11,7 +13,7 @@ ext2.img: $(PROGS)
mkdir mnt/miguel
echo "hello one" > mnt/miguel/test1.txt
echo "hello two" > mnt/test2.txt
- cp $< mnt
+ cp $^ mnt
# cp shell.bin mnt
cp ~/temp/fool-os-stuff/binutils-fool-build/binutils/elfedit mnt
sync
diff --git a/userspace/linker.ld b/userspace/linker.ld
new file mode 100644
index 0000000..99ae573
--- /dev/null
+++ b/userspace/linker.ld
@@ -0,0 +1,28 @@
+/* OUTPUT_FORMAT(binary) */
+
+SECTIONS
+{
+ . = 0x800000;
+
+ /*
+
+ .text : ALIGN(0x1000) {
+ _TEXT_START_ = .;
+ *(.text)
+ _TEXT_END_ = .;
+ }
+
+ .data : ALIGN(0x1000) {
+ _DATA_START_ = .;
+ *(.data)
+ _DATA_END_ = .;
+ }
+
+ .bss : ALIGN(0x1000) {
+ _BSS_START_ = .;
+ *(.bss)
+ _BSS_END_ = .;
+ }
+ */
+
+}