Download Demo/Dsk/DskRaw.txt from hschumann2/TempleOS-Source-Code: direct link, hf CLI and curl.
- Browser
- Download file 805 Bytes
-
https://huggingface.co/datasets/hschumann2/TempleOS-Source-Code/resolve/main/Demo/Dsk/DskRaw.txt
- Command line
-
hf download hf://datasets/hschumann2/TempleOS-Source-Code/Demo/Dsk/DskRaw.txt
-
curl -L -o DskRaw.txt https://huggingface.co/datasets/hschumann2/TempleOS-Source-Code/resolve/main/Demo/Dsk/DskRaw.txt
805 Bytes
| U0 RawAccess(I64 drv_let=0) | |
| { | |
| CDrv *dv=Let2Drv(drv_let); | |
| CBlkDev *bd=Let2BlkDev(drv_let); | |
| I64 blk,old_offset,old_size; | |
| U8 *buf=MAlloc(BLK_SIZE); | |
| DrvRep; | |
| PressAKey; | |
| ClassRep(dv); | |
| PressAKey; | |
| ClassRep(bd); | |
| PressAKey; | |
| //Temporarily change partition range to full device. | |
| //Normally, you are limited to just your partition. | |
| //This is obviously dangerous! | |
| old_offset=dv->drv_offset; | |
| old_size =dv->size; | |
| dv->drv_offset=0; | |
| dv->size=bd->max_blk+1; | |
| try { | |
| blk=GetI64("Blk to Read: ",old_offset,0,bd->max_blk); | |
| BlkRead(dv,buf,blk,1); | |
| D(buf,BLK_SIZE); | |
| } catch | |
| PutExcept; | |
| dv->drv_offset=old_offset; | |
| dv->size =old_size; | |
| Free(buf); | |
| } | |
| RawAccess; | |
| //See BlkRead(), BlkWrite(), DrvLock(), DrvUnlock() | |
| //DBlk(), DClus(), BlkDevLock() and BlkDevUnlock(). | |