/dpt/ - Daily Programming Thread

Name a worse language than VBA

batch

english

we lambdas now

sepples

Attached: handlers.png (866x214, 19K)

Writing some data to a nosql database with node.js

I'm storing one context for each user program (in their PCBs) and then one for the scheduler state.
My SWI handler basically saves the user context back to its PCB, then loads the scheduler's stack pointer and executes whatever function handles the particular system call.
If an interrupt were to arrive in the middle of the SWI handler itself, I don't have anywhere to put its state. I also don't have anywhere to put the state of a function implementing the requested system call if that were interrupted.

Hmm. I think I don't know enough about ARM to give you a helpful answer. Sorry :( I would look for a small ARM preemptive kernel and see how it's implemented. Maybe something like this? github.com/jserv/mini-arm-os/tree/master/06-Preemptive

FWIW in my kernel I don't change process context when handling a software interrupt, although I do use the x86 hardware to switch to the current process' dedicated kernel stack. I only ever change process context from the scheduler (which can be invoked by the timer IRQ or by making a yield() syscall.)

Added support for enums in my programming language, you can also add "bitflags" prefix to the enum identifier to automatically turn the enum values into bitmask flags, such as:
enum bitflags Color = (Red, Green, Blue, Alpha)


Will result in:
Color.Red = 1
Color.Green = 2
Color.Blue = 4
Color.Alpha = 8

>when you use python for so long that you become python

Attached: 1528023982995.gif (305x320, 890K)

I need a JAVA book with good exercises so I can get a job after uni.

any recommendations?