Skip to content

Commit

Permalink
tools: assignments: 2-uart: Fix environment setup
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandra Sandulescu <[email protected]>
  • Loading branch information
alexandrasandulescu committed Mar 29, 2018
1 parent 0eafede commit acb165f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
16 changes: 15 additions & 1 deletion tools/labs/qemu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ YOCTO_IMAGE=core-image-minimal-qemu$(ARCH).ext4
QEMU_OPTS = -kernel $(ZIMAGE) \
-device virtio-serial \
-chardev pty,id=virtiocon0 -device virtconsole,chardev=virtiocon0 \
-serial pipe:pipe1 -serial pipe:pipe2 \
-net nic,model=virtio,vlan=0 -net tap,ifname=tap0,vlan=0,script=no,downscript=no \
-drive file=$(YOCTO_IMAGE),if=virtio,format=raw \
--append "root=/dev/vda console=hvc0" \
--display $(QEMU_DISPLAY) -s

boot: .modinst tap0
boot: .modinst tap0 pipe1.in pipe1.out pipe2.in pipe2.out
ARCH=$(ARCH) qemu/qemu.sh $(QEMU_OPTS)

TEMPDIR := $(shell mktemp -u)
Expand Down Expand Up @@ -54,6 +55,19 @@ $(YOCTO_IMAGE):
tap0:
qemu/create_net.sh $@

pipe1.in:
mkfifo $@

pipe1.out:
mkfifo $@

pipe2.in: pipe1.out
ln $< $@

pipe2.out: pipe1.in
ln $< $@


clean::
rm -f .modinst

Expand Down
6 changes: 3 additions & 3 deletions tools/labs/templates/assignments/2-uart/checker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ CFLAGS = -Wall -g -static -m32

.PHONY: all run clean

all: test link_handler.ko
all: test solution.ko

test: _test/test.o
$(CC) $(CFLAGS) -o $@ $^

link_handler.ko: _test/link_handler.ko
solution.ko: _test/solution.ko
ln -s $< $@

clean:
-rm -f *~ test _test/test.o link_handler.ko
-rm -f *~ test _test/test.o solution.ko
4 changes: 2 additions & 2 deletions tools/labs/templates/assignments/2-uart/checker/README
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ _checker
_test/test.c
* test suite for UART16550

_test/link_handler.ko
_test/solution.ko
* kernel module implementing UART16550,
used to transmit/receive data to/from your kernel module

Expand All @@ -28,7 +28,7 @@ Use the Makefile to properly build the test executable:

== RUNNING ==

Copy your uart16550.ko module and _checker, test and link_handler.ko
Copy your uart16550.ko module and _checker, test and solution.ko
to fsimg/root directory on your QEMU/KVM virtual machine.

In order to run the test suite you can use the _checker script.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define OPTION_BOTH 3

#define MODULE_NAME "uart16550"
#define SOLUTION_NAME "link_handler"
#define SOLUTION_NAME "solution"

#define PAD_CHARS 60

Expand Down
1 change: 0 additions & 1 deletion tools/labs/templates/assignments/2-uart/uart16550.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

#endif


#define UART16550_IOCTL_SET_LINE 1

struct uart16550_line_info {
Expand Down

0 comments on commit acb165f

Please sign in to comment.