summaryrefslogtreecommitdiff
path: root/bsp
diff options
context:
space:
mode:
authorparai.wang <[email protected]>2017-08-16 15:47:15 +0800
committerparai.wang <[email protected]>2017-08-16 15:47:15 +0800
commit5ba5ebc8bead73e22378a3843b75433eca4e036e (patch)
tree54287dfbded75e0ee43964448be656bbc9194d08 /bsp
parentd6fa9f912d44d3a379db6378fedd701a6bd0dc88 (diff)
x86: host machine native gcc support and use qemu to run
Diffstat (limited to 'bsp')
-rw-r--r--bsp/x86/Makefile16
-rw-r--r--bsp/x86/drivers/board.c9
-rw-r--r--bsp/x86/rtconfig.py12
3 files changed, 30 insertions, 7 deletions
diff --git a/bsp/x86/Makefile b/bsp/x86/Makefile
new file mode 100644
index 0000000000..7e814fb42e
--- /dev/null
+++ b/bsp/x86/Makefile
@@ -0,0 +1,16 @@
+
+all:floppy.img
+ scons
+ mkdir -p tmp
+ sudo mount -t vfat floppy.img tmp -o loop
+ sudo cp rtthread.elf tmp/boot/oskernel
+ sudo umount tmp
+
+clean:
+ scons -c clean
+
+floppy.img:
+ wget https://github.com/bajdcc/tinix/raw/master/floppy.img
+
+run:
+ qemu-system-i386 -fda floppy.img -boot a -m 64M
diff --git a/bsp/x86/drivers/board.c b/bsp/x86/drivers/board.c
index 29589b0712..4d91604ab3 100644
--- a/bsp/x86/drivers/board.c
+++ b/bsp/x86/drivers/board.c
@@ -71,5 +71,12 @@ void reboot(void)
}
FINSH_FUNCTION_EXPORT(reboot, reboot PC)
#endif
-
+#ifdef RT_USING_DFS
+#include <time.h>
+time_t time(time_t* tm)
+{
+ (void)tm;
+ return 0;
+}
+#endif
/*@}*/
diff --git a/bsp/x86/rtconfig.py b/bsp/x86/rtconfig.py
index 9819969924..e99ddfe324 100644
--- a/bsp/x86/rtconfig.py
+++ b/bsp/x86/rtconfig.py
@@ -32,20 +32,20 @@ BUILD = 'debug'
if PLATFORM == 'gcc':
# toolchains
- PREFIX = 'i686-elf-'
- CC = PREFIX + 'gcc'
- AS = PREFIX + 'gcc'
+ PREFIX = ''
+ CC = PREFIX + 'gcc -m32 -fno-builtin -fno-stack-protector'
+ AS = PREFIX + 'gcc -m32'
AR = PREFIX + 'ar'
- LINK = PREFIX + 'gcc'
+ LINK = PREFIX + 'ld -melf_i386'
TARGET_EXT = 'elf'
SIZE = PREFIX + 'size'
OBJDUMP = PREFIX + 'objdump'
OBJCPY = PREFIX + 'objcopy'
- DEVICE = ' -mtune=generic'
+ DEVICE = ''
CFLAGS = DEVICE + ' -Wall'
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp'
- LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread-ia32.map,-cref,-u,_start -T x86_ram.lds -nostdlib'
+ LFLAGS = DEVICE + ' -Map rtthread-ia32.map -T x86_ram.lds -nostdlib'
CPATH = ''
LPATH = ''