Where is the "download mode" code stored? At least Samsung Galaxy series devices support download mode(also known as Odin mode or flash mode) which usually can be accessed by pressing down specific buttons while powering on the phone. Is this download mode on a small separate partition on internal-storage like recovery mode? Or is it device-dependent?
Depends on how corporate paranoia is going at the time or their design tactics.  A lot of Samsung's download mode is coded within the secondary bootloader. I'm not seeing a non .pdf that I'm happy with but Many references are easily found around the worldwide web. Keywords: secondary bootloader. (edit added detail below)

First attempt to add more details was too long. incase you want more details about the process involved some links at the. Bottom to give a base for research.

Per Samsung knox website refer to PG. 7 under Boot Loader/ Primary Boot Loader/ Secondary Boot Loader: glossary of terms


  The SBL adds functions for erase and programming of flash memory and EEPROM; it also handles the actual download of new or updated software. This allows a minimum ROM utilization by the PBL.


Now compare it to what Odin mode does and You will notice similarities. That fact that the bootloader itself can be used as a gateway to obtain sensitive corporate documents. Including the fact that both Qualcomm and Samsung Knox have multiple defense contracts. Makes it tough to find officially supported documentation such as spec sheets or R&amp;D documentation but not impossible.

IBM Linux boot

Android bit fastboot protocols

The new android book process..    

stack exchange boot and aboot   

Google fastboot protocol