Tutorial test request
Tutorial test request
Hi,
I've created the code for a new tutorial - on entering usermode and syscalls. If anyone's got the time spare I'd really appreciate it if you could maybe (a) have a test of the image file/compile the code, see if it works (it should print "Hello, user world!"), and/or (b) have a look through the source and see if you understand it - more comments needed? less comments?
http://www.jamesmolloy.co.uk/downloads/user_mode.tar.gz
Thanks.
James
I've created the code for a new tutorial - on entering usermode and syscalls. If anyone's got the time spare I'd really appreciate it if you could maybe (a) have a test of the image file/compile the code, see if it works (it should print "Hello, user world!"), and/or (b) have a look through the source and see if you understand it - more comments needed? less comments?
http://www.jamesmolloy.co.uk/downloads/user_mode.tar.gz
Thanks.
James
Hi James,
I have tested the image on Bochs 2.3.5, VPC and real hardware and it works as you say it should on all 3.
I have attempted a compile on Cygwin and get the error:
On removing this option, it all compiles with warnings:
...and none of it links. Before you start worrying too much, I have compiled with cygwin's default compiler (*old*) as I ususally use a custom toolchain and didn't think it was much use to you to compile with that. Although that probably explains the linking issue, the warnings above obviously still need looking at (not meant to sound patronising!).
Unfortunately, I don't have enough time to look through code at the moment.
HTH,
Adam
I have tested the image on Bochs 2.3.5, VPC and real hardware and it works as you say it should on all 3.
I have attempted a compile on Cygwin and get the error:
Code: Select all
cc1: error: unrecognised command line option "-fno-stack-protector"
Code: Select all
interrupt.s:70: warning: signed byte value exceeds bounds
paging.c:157: warning: passing arg 2 of `register_interrupt_handler' from incompatible pointer type
syscall.c:56: warning: `return' with a value, in function returning void
Unfortunately, I don't have enough time to look through code at the moment.
HTH,
Adam
- einsteinjunior
- Member
- Posts: 90
- Joined: Tue Sep 11, 2007 6:42 am
Hi,
AJ, einsteinjunior: Thanks so much for testing it out so quickly!
I've uploaded a new tarfile with the -fno-stack-protector flag removed (not exactly sure how it crept back in there, i'd removed it in all other tarfiles!) and the warnings fixed.
I'm not sure about your link problem AJ - It links perfectly on my system! :S
Thanks again,
James
New tarfile can be found at the same place: http://www.jamesmolloy.co.uk/downloads/user_mode.tar.gz
AJ, einsteinjunior: Thanks so much for testing it out so quickly!
I've uploaded a new tarfile with the -fno-stack-protector flag removed (not exactly sure how it crept back in there, i'd removed it in all other tarfiles!) and the warnings fixed.
I'm not sure about your link problem AJ - It links perfectly on my system! :S
Thanks again,
James
New tarfile can be found at the same place: http://www.jamesmolloy.co.uk/downloads/user_mode.tar.gz
- einsteinjunior
- Member
- Posts: 90
- Joined: Tue Sep 11, 2007 6:42 am
-
- Member
- Posts: 89
- Joined: Sun Mar 23, 2008 2:23 pm
- Location: [0x8:0x1000]
Try this to compile the kernel on cygwin :
You must build a cross compiler ( look at the OsFaq ) .
Code: Select all
i586-elf-gcc -ffreestanding -mno-stack-arg-probe -c kernel.c -o kernel.o
i586-elf-ld -e kernel_main -Ttext 0x1000 -o kernel anotherobject.o kernel.o
i586-elf-objcopy -R .note -R .comment -S -O binary kernel kernel.bin
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Could someone test forking? Without the switch_to_user_land call, it pagefaults for me.
-JL
-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
with cygwin's gcc, it fails at the linking step (leading underscores, reference to __alloca and friends). Using my standard cross-compiler makes it compile cleanly. The floppy image works as expected.
and of course, the sudo/loopback device scripts don't work on a windows platform.
I've quickly glanced over the source code and it looks decent.
and of course, the sudo/loopback device scripts don't work on a windows platform.
I've quickly glanced over the source code and it looks decent.
For 64bit linux boxes:
Code: Select all
CFLAGS=-nostdlib -nostdinc -fno-builtin -m32
LDFLAGS=-Tlink.ld -m elf_i386
C8H10N4O2 | #446691 | Trust the nodes.