There aren't any syscalls for flash writing, but there are OS functions for this.
I have written a diags software writer a while ago but it was quite unstable, I'm not sure why. That's why the functions aren't exported.
You may also have a look at nspire_emu's source code to understand low-level interactions with the flash chip.
I think you need to emulate on an OS with a boot1 for nspire_emu to take into account a boot2 update.