undergraduate assembly language instruction sweetened with...

6
Undergraduate Assembly Language Instruction Sweetened with the Raspberry Pi Jalal Kawash Department of Computer Science University of Calgary Calgary, Alberta, Canada +1 403 220 6619 [email protected] Andrew Kuipers Department of Computer Science University of Calgary Calgary, Alberta, Canada +1 403 220 6015 [email protected] Leonard Manzara Department of Computer Science University of Calgary Calgary, Alberta, Canada +1 403 220 3518 [email protected] Robert Collier School of Computer Science Carleton University Ottawa, Ontario, Canada +1 613 520 4333 [email protected] ABSTRACT It is widely recognized that motivating students in an undergraduate assembly language course is a tremendous challenge, principally because of the perception that the subject matter is both difficult and tedious. The Raspberry Pi is a small and inexpensive single-board computer that was created for educational purposes, and in this paper we describe how we successfully incorporated this device into the curriculum of an undergraduate assembly language course. We describe, in detail, the objectives for this course and the dedicated lab that uses the Raspberry Pi as an embedded device, and then evaluate the effectiveness of our approach. Our findings (obtained by exploring changes in student performance and examining the results of an engagement/enjoyment survey) strongly indicate that the introduction of the Raspberry Pi was well received by the students and contributed positively to their learning outcomes. Keywords Computer Science Education, Raspberry Pi, Assembly Language Programming, Hardware/Software Interface 1. INTRODUCTION In recent educational practice, computer science students are typically introduced to programming by learning a high-level computer language. Although the importance of being able to program in a high-level language is undeniable, it would be difficult to argue that learning assembly language is not crucial for understanding the underlying computer architecture. Unfortunately, although assembly language remains a fundamental topic in computer science, novice assembly language programmers often find the process of programming in it tiresome and frustrating. This is not surprising, since programming in assembly is typically a tedious process, and is often described as "dry" [1], "difficult to learn", and "confusing" [2]. Naturally, this impression can be exaggerated if the course is concerned with difficult advanced assembly language programming techniques, despite the fact that these techniques are considered essential in many computer science, information technology, and engineering programs. As a result, post-secondary educators are strongly motivated to make the process of learning assembly language more engaging and rewarding for students. The Raspberry Pi, released in 2012 as an educational tool for computer science, is an affordable, relatively small device that contains an ARM11 [6] processor and supports a wide range of peripherals. Its inclusion of a General Purpose Input/Output (GPIO) interface [7] makes it especially suitable for teaching a wide variety of I/O protocols. Our decision to use the Raspberry Pi in an assembly language programming course was motivated by the desire to make the process of learning assembly language more enjoyable for the students, while offering them exposure to a contemporary architecture (similar to what they may encounter in today’s ubiquitous mobile devices). It is also our belief that both seeing and closely working with an actual physical device (as opposed to an invisible and remote server) will help students break down the conceptual barrier between software and hardware. Hence, the main research question this paper intends to answer is whether the adoption of the Raspberry Pi can improve both the learning experience and outcomes of students. The Raspberry Pi is usually equipped with a Linux operating system, and educational institutions that employ the Pi typically use it as a stand-alone computer (running Linux). Our approach, in contrast, is to use the Pi as an embedded device. Programming for direct hardware control is not possible when there is an overprotective operating system guarding hardware resources, so we use a minimal OS (employing only a first-stage bootloader) on the Pi, which allows students to program the hardware directly. Although the Raspberry Pi has been adopted as an educational tool by many colleges (and, in [8], as a motivator for high school students), the novelty of the device entails that there are only a few studies that analyse these experiences in depth. For example, Brock et al. discuss how the Pi is being used across a range of secondary-school computer courses [5], while Foltz discusses how it is used to teach network administration at the undergraduate level [9]. Although Hooper discusses (at an introductory level) how to program the Raspberry Pi at a low level using C++ and ARM assembly in a workshop [10], to the best of our knowledge our use of the Raspberry Pi to teach low-level programming in an undergraduate computer science course is unique. There are alternatives to the Raspberry Pi for teaching the hardware/software interface (for example, embedded devices such as the Arduino or FPGAs have been used for this purpose), but these devices often do not feature a comparable set of built-in peripheral interfaces. Also, it is possible to use an architecture that supports an operating system with a "real-mode" (allowing direct access to hardware) and the course described in this paper evolved Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. SIGCSE '16, March 02-05, 2016, Memphis, TN, USA © 2016 ACM. ISBN 978-1-4503-3685-7/16/03…$15.00 DOI: http://dx.doi.org/10.1145/2839509.2844552 498

Upload: others

Post on 21-May-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Undergraduate Assembly Language Instruction Sweetened with ...pages.cpsc.ucalgary.ca/~kawash/RPi/sigcse16.pdf · the introduction of the Raspberry Pi was well received by the students

Undergraduate Assembly Language Instruction Sweetened with the Raspberry Pi

Jalal Kawash Department of Computer Science

University of Calgary Calgary, Alberta, Canada

+1 403 220 6619 [email protected]

Andrew Kuipers Department of Computer Science

University of Calgary Calgary, Alberta, Canada

+1 403 220 6015 [email protected]

Leonard Manzara Department of Computer Science

University of Calgary Calgary, Alberta, Canada

+1 403 220 3518 [email protected]

Robert Collier School of Computer Science

Carleton University Ottawa, Ontario, Canada

+1 613 520 4333 [email protected]

ABSTRACT It is widely recognized that motivating students in an undergraduate assembly language course is a tremendous challenge, principally because of the perception that the subject matter is both difficult and tedious. The Raspberry Pi is a small and inexpensive single-board computer that was created for educational purposes, and in this paper we describe how we successfully incorporated this device into the curriculum of an undergraduate assembly language course. We describe, in detail, the objectives for this course and the dedicated lab that uses the Raspberry Pi as an embedded device, and then evaluate the effectiveness of our approach. Our findings (obtained by exploring changes in student performance and examining the results of an engagement/enjoyment survey) strongly indicate that the introduction of the Raspberry Pi was well received by the students and contributed positively to their learning outcomes.

Keywords Computer Science Education, Raspberry Pi, Assembly Language Programming, Hardware/Software Interface

1. INTRODUCTION In recent educational practice, computer science students are typically introduced to programming by learning a high-level computer language. Although the importance of being able to program in a high-level language is undeniable, it would be difficult to argue that learning assembly language is not crucial for understanding the underlying computer architecture. Unfortunately, although assembly language remains a fundamental topic in computer science, novice assembly language programmers often find the process of programming in it tiresome and frustrating. This is not surprising, since programming in assembly is typically a tedious process, and is often described as "dry" [1], "difficult to learn", and "confusing" [2]. Naturally, this impression can be exaggerated if the course is concerned with difficult advanced assembly language programming techniques, despite the fact that these techniques are considered essential in many computer science, information technology, and engineering

programs. As a result, post-secondary educators are strongly motivated to make the process of learning assembly language more engaging and rewarding for students.

The Raspberry Pi, released in 2012 as an educational tool for computer science, is an affordable, relatively small device that contains an ARM11 [6] processor and supports a wide range of peripherals. Its inclusion of a General Purpose Input/Output (GPIO) interface [7] makes it especially suitable for teaching a wide variety of I/O protocols. Our decision to use the Raspberry Pi in an assembly language programming course was motivated by the desire to make the process of learning assembly language more enjoyable for the students, while offering them exposure to a contemporary architecture (similar to what they may encounter in today’s ubiquitous mobile devices). It is also our belief that both seeing and closely working with an actual physical device (as opposed to an invisible and remote server) will help students break down the conceptual barrier between software and hardware. Hence, the main research question this paper intends to answer is whether the adoption of the Raspberry Pi can improve both the learning experience and outcomes of students.

The Raspberry Pi is usually equipped with a Linux operating system, and educational institutions that employ the Pi typically use it as a stand-alone computer (running Linux). Our approach, in contrast, is to use the Pi as an embedded device. Programming for direct hardware control is not possible when there is an overprotective operating system guarding hardware resources, so we use a minimal OS (employing only a first-stage bootloader) on the Pi, which allows students to program the hardware directly.

Although the Raspberry Pi has been adopted as an educational tool by many colleges (and, in [8], as a motivator for high school students), the novelty of the device entails that there are only a few studies that analyse these experiences in depth. For example, Brock et al. discuss how the Pi is being used across a range of secondary-school computer courses [5], while Foltz discusses how it is used to teach network administration at the undergraduate level [9]. Although Hooper discusses (at an introductory level) how to program the Raspberry Pi at a low level using C++ and ARM assembly in a workshop [10], to the best of our knowledge our use of the Raspberry Pi to teach low-level programming in an undergraduate computer science course is unique.

There are alternatives to the Raspberry Pi for teaching the hardware/software interface (for example, embedded devices such as the Arduino or FPGAs have been used for this purpose), but these devices often do not feature a comparable set of built-in peripheral interfaces. Also, it is possible to use an architecture that supports an operating system with a "real-mode" (allowing direct access to hardware) and the course described in this paper evolved

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]. SIGCSE '16, March 02-05, 2016, Memphis, TN, USA © 2016 ACM. ISBN 978-1-4503-3685-7/16/03…$15.00 DOI: http://dx.doi.org/10.1145/2839509.2844552

498

Page 2: Undergraduate Assembly Language Instruction Sweetened with ...pages.cpsc.ucalgary.ca/~kawash/RPi/sigcse16.pdf · the introduction of the Raspberry Pi was well received by the students

frxinim

TStycbo(vthf

2T3fsfNthuBcawinlohth

TWrsosew

TthAEa“sArtordpitthrmfww

from a course thx86 architecture ndicate that the mproves both stu

The remainder oSection 2 and Seypical hardware

course objectivesbrief description of the course (fand quantitative

version of the cohe Raspberry Pi

final discussions

2. THE COThe subject of th359) course at thfor students puscience at the Unfor the third-yNetworks, and Phe course title, t

undergraduate cBachelor’s degrcourse, students and general comwhile in CPSC nterface. Studenogic design, m

handling, and hahese topics, this

The enrollment iWinter 2015 sespectively, wit

students per lab tof lecture time cosessions, designeexperience with were conducted b

The main studenhe course is an

ARM assemblEntertainment Syand an HDMI m“bare metal” (osystem), in a maAlthough the gepresentative exo traverse a epresentation of

draw a title screepermitted a finittems in order tohe program museceive input fr

moving a charafailure messages were evaluated owere given the op

at used Window[3]. NeverthelesRaspberry Pi is udent engageme

of this paper isection 3 are use

e/software setup s are discussed iof the format a

for comparison)e) assessment o

ourse, and detaili is discussed anpresented in Sec

OURSE his paper is the he University ofursuing an undniversity of Cal

year courses CPrinciples of Opethis is the seconcourses, both oree in Computare exposed to

mputer architec359 the empha

nts enrolled in ticroarchitecture ardware I/O. It paper is concern

in the course forsemesters wereth students divitutorial. A typicomplemented byed to parallel thethe Raspberry Pby graduate teac

nt deliverable inn interactive viy language, ystem (SNES) c

monitor for outpuon the ARM panner that is typigame itself wouxample would be

maze. In addf the maze itselfen and menu elete number of aco proceed, all ofst track and reprom the SNES cter), and preseas required. It s

on the quality ofption to work in

ws 98 running inss, the results ofa viable alterna

ent and performa

s organized inted to describe th

of a workstatioin Section 4 andand topics of the. Section 6 givof student perfed student feedb

nd analyzed in Sction 8 to conclu

Computing Maf Calgary. It is

dergraduate deggary, and is a p

Computer Strucerating Systems.

nd of a pair of eaof which are mer Science. In assembly langu

cture and organasis is on the hthis course are e

design, interrushould be note

ned primarily wi

r the Fall 2013, 61, 112, anided into group

cal week consistey 100 minutes ofe lectures by proPi in a specializeching assistants.

n the Raspberry deo game deveusing a Su

controller [12] aut. The game is rprocessor withoical for many emuld vary betwee a game that redition to the f, the students wements. The playctions and woulf which comprisport to the user.

controller (opent the player should also be nf their code, andgroups of up to

n real-mode on thf our investigatioative platform thance.

o seven sectionhe course and thon in our lab. Thd Section 5 givese previous versioves a comparativformance in eacback on the use ection 7, with o

ude the paper.

achinery II (CPSa required cour

gree in computprerequisite courctures, Comput. As suggested barly (second-yeamandatory for

the prerequisiuage programminnization concepthardware/softwaexposed to digitupts and interrued that, out of aith hardware I/O

Winter 2014, annd 120 studentps of at most 2ed of 150 minutf lab time. The laviding a hands-o

ed lab (Section 3

Pi component eloped entirely uper NintendoT

s an input devicrequired to run oout an operatinmbedded systemeen semesters, equired the playactual graphic

would also need yer would only bld need to colleses game data th

The game woupening doors anwith success an

noted that studend that the studenthree members.

he on hat

ns. he he s a on ve ch of

our

SC rse ter rse ter by ar)

a ite ng ts,

are tal

upt all

O.

nd ts, 22 tes ab on 3),

of in

TM ce, on ng

ms. a

yer cal to be ect hat uld nd nd nts nts

3. LAWritinga set odirectlysuch aswill be a compdebuggbe perfprobleminterfacstudentand prodoes nosoftwarcreatedhost cowith thboth th

3.1 HIn ordefor the cross ctransferprogramThe adincludin

a) Rab) Cuc) Sed) Sue) HDf) US

Much commuOutput createdvariousthe hosdebuggconnecRaspbeinterfacacross text-baconnec

AB SETUPg bare-metal assof challenges noy on a Pi equips Linux. The pr running a minim

piler and systemging cannot take formed on a hosm. While the ce, it is unreasots to write a USoviding a librarot help them undre level. To sol

d with 30 studenomputer and a she Raspberry Pihe hardware and

Hardware Ser to facilitate sRaspberry Pi, th

compiling a prorring compiled ms running on tdditional hardwng the host comp

aspberry Pi ustom Breakout eggerTM JLink Euper NintendoTM

DMI Interface SB to TTL Seria

Figure 1. W

of the hardwaunicate over the

(GPIO) interfacd to connect the s devices used ist computer are tged using the cts to the hosterry Pi across thce (f) also connethe GPIO intersed serial input

cted to the GPI

P sembly code for ot encountered wpped with a fullrincipal difficulmal operating sy

m-level I/O. Con place on the dest computer. BaRaspberry Pi

onable to expect SB keyboard or ry or pre-made derstand how inlve these challent workstations,

suite of supportii. The details osoftware perspe

Setup students writinghe workstations ogram targeted programs to th

the Raspberry Pware connected mputer) is shown

Board EDU Debugger [M Entertainment

al Interface

Workstation H

are used in the Raspberry Pi'ce, and so a custRaspberry Pi's

in the workstatitransferred to theJLink EDU d

t computer's Uhe GPIO interfaects the host co

rface, and providand output. TheIO interface, a

the Raspberry Pwhen developinl-featured operaty is that the Rystem that does

nsequently, compevice itself, but iasic user input ais equipped wsecond-year unmouse driver i

driver to handlenput is handled aenges, a dedicat, each of whiching hardware thaof these workstactives, are descr

g bare-metal assneed to provideto the ARM a

he Raspberry PiPi, and facilitatin

to the Raspbein Figure 1, and

11] System (SNES)

ardware Suite.

he workstation's General Purptom breakout bo26-pin GPIO h

ion. Programs ce Raspberry Pi a

debugging unit USB interface ce. The USB to

omputer to the Rdes a means of

e SNES controlleand provides an

Pi introduces ng programs ating system Raspberry Pi

not provide pilation and instead must also poses a

with a USB ndergraduate n assembly, e user input at the lowest ted lab was h includes a at interfaces ations, from ribed below.

sembly code e support for architecture, , debugging ng user I/O.

erry Pi (not d includes:

Controller

 

s needs to pose Input / oard (b) was eader to the

compiled on and remotely

(c), which and to the

o TTL serial Raspberry Pi f performing er (d) is also n additional

499

Page 3: Undergraduate Assembly Language Instruction Sweetened with ...pages.cpsc.ucalgary.ca/~kawash/RPi/sigcse16.pdf · the introduction of the Raspberry Pi was well received by the students

method of user input. Finally, the Raspberry Pi's native HDMI interface (e) is connected to a monitor, which provides a means of graphical output from the Raspberry Pi.

3.2 Software Setup Writing bare-metal assembly for the Raspberry Pi involves a different software setup than would be used to write and run programs directly on the device itself. Given that the Raspberry Pi will not be using a full-featured operating system (that is, instead of Linux we use a simple operating system that does not provide facilities such as text editors, compilers, or debuggers), students must edit and compile their programs on a different computer system, herein referred to as the host. The compiler on the host must be able to cross-compile source code to produce executable binaries that run on the Raspberry Pi. Debugging provides an additional challenge, since the host debugger is interacting with a program running on a remote system.

The software setup used on the workstations involves a distribution of the Linux operating system. A version of the GNU Compiler Collection (gcc), built to target the Raspberry Pi's ARM11 architecture, was installed on the workstations, providing a cross-platform compiler and debugger. Additionally, the GNU Debugger (gdb) Server provided by SeggerTM (JLinkGDBServer) was installed on the host computers to allow communications between the gdb debugging client on the host and the JLink EDU remote debugging unit connected to the Raspberry Pi.

In order to establish a connection between the JLink EDU remote debugging unit and the Raspberry Pi, the GPIO lines used for JTAG communication must be set to the correct mode using a sequence of software commands. To accomplish this, a "minimal" kernel image with just enough code to enable the JTAG GPIO lines is compiled by the students and copied to the SD card from the host computer, and the Raspberry Pi is powered on with this SD card inserted. One difficulty here is that, at the time that this paper was authored, the details of the first-stage bootloading process were not currently publicly available, so students were not able to recreate this stage of the bootloading process themselves. To solve this problem, an SD card is first written with the original Raspbian distribution (available on the Raspberry Pi website, and which includes the first-stage bootloader), and then modified by overwriting the kernel image file used in the second-stage of the bootloading process with the "minimal" kernel image.

Once the Raspberry Pi is powered on with an SD card containing the "minimal" kernel image, the JLinkGDBServer can be started on the host computer. After a successful connection has been made and the debugger server is running, the students can start the ARM-targeted gdb client using a kernel image they have compiled with the ARM-targeted compiler, and establish a remote debugging connection to the JLinkGDBServer instance. At this point, the student executes a command in the gdb client to upload the kernel image to the Raspberry Pi's memory, sets the Raspberry Pi's program counter register to the beginning of the kernel image, and continues execution on the device. If successful, the student's new kernel image will now be running on the device.

3.3 Additional Considerations While the overall experience of working with the Raspberry Pi was generally advantageous to students, it should be noted that the specialized lab we created came with a price tag of more than $30,000 (CAD) for about 34 workstations (including 4 workstations for instructional staff). Although this cost might be considered prohibitive for some institutions, it is worth noting that the lab was constructed with completely new equipment,

including new top-of-the-line host machines and dual monitors (one for the host and a HDMI monitor for the Raspberry Pi). Consequently, it should be noted that this price tag could be reduced substantially by simply equipping an existing lab of host machines; the add-on price for converting an existing lab to make it Raspberry Pi-ready can be very minimal, and would include only the price for HDMI monitors (if necessary), JLink devices, and a few inexpensive accessories. Furthermore, there are cheaper display options than the HDMI monitors used in our lab that can be used with the Raspberry Pi's RCA video output.

The cost of the Raspberry Pi itself and its accessories is very low; the price for an assembled kit (which includes a power supply adapter, SIM card, cables, and protective case) was about $85 (CAD) in Winter 2015. Note that all students were required to purchase the Pi and accessories when registering for the course.

It should also be noted that, with the enrollment in the winter semester exceeding 100 students, the students were struggling to find lab time and space during peak times close to assignment due dates. Not being able to work from home (due to the specialized hardware required) was a clear disadvantage to students, but duplicating a lab workstation at home incurs a relatively low cost, and can be encouraged in future offerings. Students would need only an extra HDMI screen, a JLink EDU device, and our locally-manufactured breakout board.

4. COURSE OBJECTIVES As this paper describes the use of the Raspberry Pi for assembly language instruction, it is worth noting that several Raspberry Pi topics are considered course objectives, including (but not limited to) the following:

Advanced ARM Assembly Programming: Students are exposed to stacks, the concept of subroutines (as implemented in assembly language), two-dimensional arrays, and interrupt service routines.

General-Purpose Input/Output: GPIO is a well-known mechanism used to provide flexible I/O for microcontrollers. GPIO allows the students to connect a wide range of I/O devices to the Raspberry Pi. However, a substantial amount of programming is required to write device interface functions (i.e., GPIO is not plug-and-play). Students are expected to become proficient in the use of GPIO registers, including those that set the function for a GPIO line (e.g., input, output, or a special function) and those that read or set the values of the GPIO lines [7].

Universal Asynchronous Receiver/Transmitter Protocol: UART is a low speed serial protocol used ubiquitously for simple communication between devices. The Raspberry Pi provides support for UART (and a reduced implementation called mini-UART) through its GPIO interface. The protocol is relatively easy to present to students, and students are required to implement a driver for a generic UART device from scratch.

Video Programming: The Raspberry Pi provides support for video programming via a frame-buffer architecture accessed through memory-mapped I/O (that is, the frame-buffer is accessed through memory load and store instructions). On the Raspberry Pi, the buffer is initialized through a mailbox interface, and is used to establish communication between the ARM core and the video core (or GPU). A suite of registers in addition to RAM is used for this communication, and the use of these registers, along with the protocol for initializing the frame-buffer [7,13], are both areas in which the students must become proficient.

Interrupts and Exceptions: The ARM architecture has a number of different execution modes, and software or hardware

500

Page 4: Undergraduate Assembly Language Instruction Sweetened with ...pages.cpsc.ucalgary.ca/~kawash/RPi/sigcse16.pdf · the introduction of the Raspberry Pi was well received by the students

epsuPlee

5ItspWmdospvooa

Tsthlithwasth

AWarAthoamcrthe

TlaUrthcer

6Aopwlepmsd

exceptions (i.e., processor. Writinstudents to undeuse the Current Program Status Rearn to program

event such as a ri

5. PREVIOt is worth noting

similar topics upredecessor courWindows 98. Thmode, which endevelop an interaof this course, students had to wprivileged operatversions of the Woption, and othoverprotective anaccess the hardw

The nature of significantly whehe predecessor cibrary (the VEShat they work w

was also necessaa resolution of specialized PS/2hey program and

As noted prevWindows 98 do and, consequentequired a specia

Although this wahere were two s

of a substantial and still applicamany students rcourse was releeceived from thhem were dis

environment that

The second issueab that consis

Unsurprisingly, epair and find shis, we resorted

course [3], but wexperience the sather than worki

6. COMPAAccording to theof Calgary, letterpoint values betwworth 4.0, A- woetter grades as

performance on module are mapscheme, it is podifferent categor

interrupts) chang and registerinerstand the vectoProgram StatusRegister (SPSR)

m an interrupt serising or falling e

OUS VERSIg that the previousing a differerse was based ohis setup allowednabled direct aactive video gamremains a sign

write specializedting system call

Windows operatiher operating nd do not allow

ware directly.

the video gamen this course wcourse, studentsSA BIOS Exten

with both port-maary for students t

1024 × 768 2 keyboard and/d register their o

viously, versionnot permit studetly, the previoalized lab (i.e., xas suitable to fuignificant issuesexplanation tha

able (regardless reported that thevant to currenthe students indicscouraged whent they literally ch

e that arose wasted of x86 mit was becominspare parts for ad to DOSBox [1we were ultimatestudents were reing directly with

ARATIVE Ae undergraduate r grades betweeween 0.0 and 4.orth 3.7, B+ wossigned to eacthe exam that pped to grade

ossible to calculries of students.

ange the executng exception hanor table architecs Register (CPSR) on the ARM Crvice routine to hedge on a GPIO

ON ous version of thent platform. Ton an Intel x86 d students to woaccess to hardwme (which, in thnificant course

d device drivers ws. Unfortunatelying system no losystems (e.g., developers to w

me deliverable as adapted to the

s needed to use nsion (VBE) [1apped and memoto work with XGwith 256 colo

/or mouse driveown interrupt han

ns of Windowents to work in rus version of x86 machines wullfil the objectivs with this lab set course concepof the computi

hey were not cot computing pracated that a signn working wiharacterized as "

s related to the smachines runnin

g progressively any failing mac7] in subsequen

ely dissatisfied weceiving while uh the actual hardw

ASSESSMENgrading system

en F and A+ are0, inclusively (w

orth 3.3, etc.) Coch student for followed the x8point values a

late mean gradeSince the Rasp

tion mode of thndlers requires thcture, and how R) and the SaveCPU [6]. Studenhandle a hardwaline.

his course covereThe lab for thplatform runnin

ork in real addreware. In order he current iteratio

deliverable), thwithout relying oy, the more receonger provide th

Linux) are towrite programs th

did not change Raspberry Pi. a low-level vide

15]), necessitatinory-mapped I/O.GA monitors (wiors), and develoers (requiring thndlers).

ws subsequent real address modthe course al

with Windows 98ves of the cours

etup. First, in spipts were universing environmenonvinced that thactices. Feedbac

nificant numberith a computinancient".

sustainability ofng Windows 9

more difficult hines. To addre

nt offerings of thwith the quality using an emulatware.

NT m at the Universie mapped to gradwith A's and A+onsequently, if th

their respectiv86 / ARM couraccording to the point values fpberry Pi was fir

he he to ed nts are

ed he ng ess to on he on ent his oo hat

ge In eo ng It ith op hat

to de so 8). se, ite sal nt), he ck of ng

f a 98. to

ess he of

tor

ity de +'s he ve rse his for rst

adoptedstudentbe divCompuand thoadoptedand x86topics. highligsame inwe recoof speeplatform

In the categorSeptemcategorafter Sevalues, standarmean gstudentgrade ocourse complethe mar

Fi

It was testing statisticplots instudentnormalline) anto demo

This tesignificinterprevery pconsondiscuss

7. SUStudentto partienjoymlearningstudent337 stu

d for this coursets that have comvided into twouting Machineryose that compled. We should n6 material was teThe marks pres

ghted that currennstructor. In botommended in eaech of each assemm and the lab we

available data,ry (i.e., those th

mber 2012 and Ary (i.e., those theptember 2013). we observe a

rd deviation) forgrade point valuets in the latter. of between C+ awith the x86, a

eted the course rks for each pop

igure 2. Distribu

necessary to tewhether the d

cally significantn Figure 3, the ts that completel (n.b., an R2 of nd, thus, requireonstrate statistic

est showed that cant (p-value < et it as evidencepositive impact nant with the sed in the follow

URVEY REts registered undicipate in a volun

ment, learning g. We have recets in two consecudents (i.e., an ov

e in the Fall semmpleted this courso categories: ty II while the xeted the course snote that in bothested in an examsented here are

nt and previous vth formats, no teach case a book mbly language (ere the only maj

, there were 13hat took the couApril 2013) andhat took the cou. After mapping

mean grade por the students ine of 2.986 (0.730These results cand B- for the s

and a mean lettewith the Raspb

pulation of studen

ution of the AR

est the normalitydifference betwet. As evidencedistribution of g

ed the course wf 0.9085 for the ed an unpaired, ncal significance.

the difference 0.0001), and s

e that the use of on student pe

feedback proviwing section.

ESULTS der the new formntary, anonymouexperience, moeived a total of cutive semestersverall response r

mester of 2013, se in the last threthose that com86 architecture since the Raspbh course versionm separate from o

for this exam. Iversions were taextbooks were rthat covered the

(x86 and ARM)or changes.

38 students in urse with the xd 319 students iurse with the Rathe letter grades

oint value of 2n the former cate0 standard deviacorrespond to a students that coer grade of B foerry Pi. The disnts is plotted in F

RM/x86 Exam G

y of these data een the mean d by the quangrades across th

with the x86 waquantile-quantilnonparametric s

was extremely o it is not unre

f the Raspberry Performance. Thided by the s

mat of the courseus survey that asotivation, and 198 valid instru, from a total enrate of 58%).

the body of ee years can

mpleted the was in use,

berry Pi was ns, the ARM other course It should be aught by the required, but e basic parts . Hence, the

the former x86 between in the latter aspberry Pi, s to numeric

2.542 (0.846 egory, and a ation) for the

mean letter ompleted the or those that stribution of Figure 2.

Grades.

sets before grades was

ntile-quantile he cohort of as not quite le plot trend student t-test

statistically easonable to Pi has had a

his result is students, as

e were asked ssessed their independent

uments from nrollment of

501

Page 5: Undergraduate Assembly Language Instruction Sweetened with ...pages.cpsc.ucalgary.ca/~kawash/RPi/sigcse16.pdf · the introduction of the Raspberry Pi was well received by the students

7TTrthA

TrwthPths

S

N

D

SD

Trplosr

Ttw(ss1Ab

Figure 3. Nor

7.1 QuantitTables 1 and 2 sTo clarify, theseesponses associhe Likert scale

Agree, Neutral, D

Table 1 shows esponded with

working with thehe students felt v

Pi, with a substaheir learning w

similarly positive

 Ite

I enjoyed wRaspb

Strongly Agree 

22.73% 

Agree  43.43% 

Neutral 

Disagree  7.58% 

Strongly Disagree 

5.56% 

Table 1. Surv

Table 2 presentseported concern

participants respow-level progra

studies). In all caeacted positively

To facilitate furthwo classes: the "a), and the "N

strongly disagreescale responses o1 and 5 inclusiveAgree" and "Strbe subjected to a

rmality Testing

tative Summshow the basic fre tables show thated with each used on the i

Disagree, and Str

the proportion each of the dif

e Raspberry Pi. very positively aantial 82.32% mwas enhanced. e reactions conce

m (a) working on the berry Pi. 

Tenh

66.16% 29.

53.

20.71% 

13.13% 

1.

1.

vey Responses C

similar data forning pursuing fuonded with agreamming, game ases, the majority to the use of th

her analyses, stu"Enjoyers", who

Non-Enjoyers", wed with the samon the other iteme, with 1 and 5 aongly Disagree"dditional statisti

with Quantile-Q

mary frequency statistihe fraction of sof the five diff

instrument (i.e.,rongly Disagree

of the survey fferent responseIt is clear from

about the impactmajority reportin

The other resperning enjoymen

Item (b) he use of the RPi anced my learning. 

.29% 82.32% 

.03% 

15.66% 

.01% 

2.02% .01% 

Concerning the

r items about thuture studies. Theement for each

programming, ty of the surveyhe Raspberry Pi.

udy participants wo agreed or stronwho were neutr

me item. By tranms into numericaassigned to respo", respectively), ical analyses.

Quantile Plots.

ics for the survesurvey participaferent values fro, Strongly Agre).

participants thes to items abo

m these results tht of the Raspberng agreement thponses expressent and motivation

Item (c) The use of the RPi motivated me... 

23.74% 67.17

43.43% 

24.75

5.05% 

8.083.03% 

Raspberry Pi.

he feeling studenhe majority of th

of the items (i.eand independe

y participants hav

were grouped ingly agreed to iteral, disagreed,

nslating the Likeal values (betweeonses of "Strong

the results cou

ey. ant om ee,

hat out hat rry hat ed n.

5% 

nts he e.,

ent ve

nto em or ert en

gly uld

 

Strongly Agree 

Agree 

Neutral

Disagree

Strongly Disagree

Tabl

When Enjoyethat theexperie(4.29) agreemcorrespAlthougfeeling differenstatistic

SimilarRaspbemotivatthe Enjonce agto agrefrom thneutralitranslatsignificpreviouwho encontrib

7.2 QThe surtheir chqualitaton whicDisagrePi") ind

The firdissatisworkinthis clenice; hinstabilThis stumodernstronglystated:super nexplainRaspbe

The seitself awork f

Item (d) I would like to learmore about low‐lev

programming. 

16.67% 52.5

35.86% 

18.6

18.69% 

28.710.10% 

le 2. Survey Res

comparing the ers, item (b) wase use of the Raspences. The meacorresponds to

ment, while theponds to a respgh the mean res"positively" abo

nce between thecally significant

rly, in item (c) (erry Pi contribtion), the mean tjoyers and the Ngain, that the meement / strong ahe Non-Enjoyeity and agreemted responses cant (p-value <usly explored itenjoyed using thebuted to both enh

Qualitative rvey participantshoices in a free-tive analysis. Thch the students ree" with item (a)dicated the prese

rst theme saw sfaction about tng environment. early: "The fact however, the explity, over-compliudent goes on ton day technoloy disagreed "ARM is a cur

novel, but painfuns: "The methoerry Pi was over

econd theme waand the scarcity from home. A

n vel 

Item (eI would like tmore aboutprogramm

53% 38.89% 

32.32% 

69% 

79% 

7.07% 

7.07% 

sponses Concer

responses of ths used to assess wpberry Pi enhancan translated rea response betw

e value from ponse between sponses would cout their learnine mean translated(p-value < 0.000

(assessing whethbuted positivelytranslated responNon-Enjoyers rean response froagreement, in coers, correspondinment. The diffewas, once aga

< 0.0001) and fem (b), the survee Raspberry Pi thanced learning a

Summary s were also give-form format, anhis analysis, resreported "Neutra) (i.e., "I enjoyeence of two unde

the majority the "fragility" aOne student (w

that we’re workperience was teication, and J-Lo say: "The relevogy is interestin

with the qurrent technologyul due to hic-upsod for communr complicated by

as centered on tof lab space anrepresentative s

e) to learn t game ming. 

I wouldindepewith s

71.21% 24.75%

35.86%

14.65% 

14.14% 

10.61%

9.09%

rning the Future

he Enjoyers witwhether the partced their individesponse from thween agreement

the Non-Enjoyneutrality and

characterize botg with the Raspbd responses wer01).

her the studentsy towards theirnses were 4.08 arespectively. Thm the Enjoyers

ontrast to the meng to a responerence betweenain, extremely for both this iteey results indicatthought that theand improved m

en the opportunitnd these were sustricted to those al", "Disagree", od working on therlying themes.

of these studeand "awkwardn

with a neutral raking on relevant erribly tarnishedink being absoluvance of the Raspng." Another suestion under y and the Rasps in the system. nication/work w

y J-Link."

the workload ofnd time, or the student states:

Item (f) d like to pursue ndent learning similar topics. 

% 60.61% 

19.70% 

19.70% % 

e Studies.

th the Non-ticipants felt

dual learning he Enjoyers t and strong yers (3.69) agreement.

th groups as berry Pi, the re extremely

felt that the r individual and 3.24, for is indicates, corresponds

ean response nse between n the mean

statistically em and the te that those

e experience motivation.

ty to explain ubjected to a

instruments or "Strongly

he Raspberry

ents express ness" of the ating) stated hardware is d by system utely awful." pberry Pi to tudent who

discussion pberry Pi is S/he further with/on the

f the course inability to

"Although I

502

Page 6: Undergraduate Assembly Language Instruction Sweetened with ...pages.cpsc.ucalgary.ca/~kawash/RPi/sigcse16.pdf · the introduction of the Raspberry Pi was well received by the students

enjoyed the idea of the RPi, the projects consumed a lot of my time, more than any other course by far. […] It was interesting to work below the OS […], but the projects required a lot of troubleshooting and we could only work on the RPi on campus."

8. CONCLUSION Teaching assembly language programming at the undergraduate level is often challenging, and this can often be attributed to the perceptions (of the students) that the topic is dull and tedious. Earlier attempts to offset this bias (in the predecessor Computing Machinery II course discussed herein) included the incorporation of video game development to introduce a "fun factor" into the student experience. While we have retained this element in our present course design, we looked at incorporating a contemporary platform that students would find more relevant to the current state of the computer industry. The use of a credit card-sized computer with an ARM processor served this purpose, largely because of prevalence of mobile devices in the students' daily lives. In this paper, we show that a significant majority of the students were more motivated to learn about the hardware/software interface and assembly language due to the use of the Raspberry Pi as a learning platform. Another majority also indicated that the Raspberry Pi improved their learning experience and enjoyment of the topic.

These results, compiled from the "self-assessments" provided by the students on the survey instruments, closely align with our own quantitative analysis of student performance. We found that there was a significant increase in mean grade point value for the exam associated with this module of the Computing Machinery II course when the course switched to the Raspberry Pi from the x86 platform. Furthermore, a reduced standard deviation (in the context of a greater mean grade value and in conjunction with a visual inspection of the distributions from Figure 2) indicates that fewer students are being "left behind" in this challenging subject.

On the task of improving the experience further, it should be noted that the Raspberry Pi seemed to convince only about 30% of the surveyed students to pursue future independent learning about low-level programming. Although this is certainly a respectable result, the task of increasing this value further remains daunting. This result raises the following question: If a student enjoys programming with assembly on the Raspberry Pi and indicates that this was a memorable learning experience, why would they remain unconvinced to learn more about the subject independently, and what can be done to address this?

Finally, while the experience was generally advantageous to a large majority of students, qualitative analysis also indicated two areas for improvement: the "unfriendly" development environment, and the accessibility to the lab. There is not much that can be done to address the perception of the development environment as "unfriendly", since cross-compilation and the use of the JLink debugging device is, at the moment, a necessary complication. Improving lab access is also difficult, since increasing the size of our lab facilities requires finding new space when space is scarce, and expending more money. One possible solution is to provide help and resources for students who wish to duplicate the development environment on a home computer. The additional cost to students is relatively minor (and, of course, entirely optional if they would rather work on campus).

There will always be trade-offs when choosing particular platforms to achieve general pedagogic aims. As we have shown,

the use of a specific platform to teach general concepts by exposing them to real-world experiences can be very beneficial to students, but, special care must be taken to ensure that "platform-specific details do not swamp pedagogic objectives." [14]

9. ACKNOWLEDGMENTS Our thanks go to the students of CPSC 359 who took part in this study. We also thank the anonymous reviewers.

10. REFERENCES [1] C. Zilles. 2005. SPIMbot: an engaging, problem-based

approach to teaching assembly language programming. In Proc. of the 2005 workshop on Computer architecture education: in conj. with the 32nd Int’l Symp. on Computer Architecture (WCAE '05). ACM, New York, NY, USA.

[2] D. Crookes. 1983. Teaching Assembly-Language Programming: A High-Level Approach. Software Microsystems, vol. 2, no. 2, pp. 40-43.

[3] J. Kawash and R. Collier. 2012. Using Video Game Development to Engage Students of Assembly Language Programming. In Proc. of the 14th annual ACM SIGITE conf. on Information technology education (SIGITE '13). ACM, New York, NY, USA, 71-76.

[4] www.raspberrypi.org

[5] J. D. Brock, R. F. Bruce, and M. E. Cameron. 2013. Changing the world with a Raspberry Pi. J. Comput. Sci. Coll. 29, 2 (December 2013), 151-153.

[6] ARM. 2010-2011. ARM Compiler Toolchain, Using the Assembler (pages 3 to 21). http://infocenter.arm.com/help/topic/com.arm.doc.dui0473c/DUI0473C_using_the_arm_assembler.pdf

[7] Broadcom Corporation.2012. BCM 2835 ARM Peripherals.

[8] J. Black, J. Brodie, P. Curzon, C. Myketiak, P. W. McOwan, and L. R. Meagher. 2013. Making computing interesting to school students: teachers' perspectives. In Proc. of the 18th ACM conf. on Innovation and technology in computer science education (ITiCSE '13). ACM, New York, NY, USA, 255-260.

[9] C. Bryan Foltz. 2014. Network administration with the Raspberry Pi. J. Comput. Sci. Coll. 29, 5 (May 2014), 66-67.

[10] W. H. Hooper. 2013. Easy as Raspberry Pi: an inexpensive platform for machine language instruction. J. Comput. Sci. Coll. 29, 1 (October 2013), 102-103.

[11] www.segger.com/jlink-debug-probes.html

[12] www.gamefaqs.com/snes/916396-snes/faqs/5395

[13] Broadcom Corporation. VideoCore® IV 3D Architecture Reference Guide.2013.

[14] Joint Task Force on Computing Curricula, ACM and IEEE Computer Society. 2013. Computer Science Curricula 2013: Curriculum Guidelines for Undergraduate Degree Programs in Computer Science. ACM, New York, NY, USA.

[15] VESA. Retrieved 2013/05/20 from: www.vesa.org

[16] DOS Protected Mode Interface (DPMI) Specification: Version 0.9 Printed 1990/07/26. Retrieved 2013/05/20 from: http://homer.rice.edu/~sandmann/cwsdpmi/dpmispec.txt

[17] DOSBox, an x86 emulator with DOS. Retrieved 2013/05/20 from www.dosbox.com

503