text: #include <stdint.h>
  
  extern uint8_t _erodata[];
  extern uint8_t _data[];
  extern uint8_t _edata[];
  extern uint8_t _sdata[];
  extern uint8_t _esdata[];
  extern uint8_t _bss[];
  extern uint8_t _ebss[];
  
  void init(void){
      uint8_t *Source = _erodata;
      uint8_t *Base = _data < _sdata ? _data : _sdata;
      uint8_t *End = _edata > _esdata ? _edata : _esdata;
  
      while(Base < End){
          *Base++ = *Source++;
      }
      Base = _bss;
      End = _ebss;
      while(Base < End){
          *Base++ = 0;
      }
  
      // Since that we jump directly from the OS, which has already enabled
      // every interrupt, rather than from the interrupt handler,
      // we don't need to enable again here.
  
      //csr_write_mie(0x888);       // Enable all interrupt soruces
      //csr_enable_interrupts();    // Global interrupt enable
  }
  
  