In memory of Ben “bushing” Byer, who passed away on Monday, February 8th, 2016.

Difference between revisions of "/dev/net/kd/request"

From WiiBrew
< /dev‎ | net‎ | kd
Jump to navigation Jump to search
(minor updates)
(Undo revision 117496 by Hallowizer (talk) that was a libogc function)
Tag: Undo
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
KD is the IOS module responsible for implementing WiiConnect24 functionality. It can perform HTTP(S) downloads, send and receive mail via SMTP, and execute a JavaScript-like language while the Wii is in standby mode.
+
The main [[WiiConnect24]] calls are done through this device.
  
 
== Ioctl listing ==
 
== Ioctl listing ==
Line 141: Line 141:
 
| 0x28 (async?)
 
| 0x28 (async?)
 
| NWC24iRequestShutdown
 
| NWC24iRequestShutdown
| 32 bytes
+
| 8 bytes
| 32 bytes
+
| 4 bytes
| Input is a u32 for the event type. This shuts down all KD processes that are running, downloading, mail, NAND writing, etc. This is probably called by IOS when the STM shutdown ioctls are used?
+
| Input is a u32 for the event type.
  
|}
+
Set a shutdown event flag.
  
== Researchers Nurture Innovative Biofuel Crops in Israels Desert ==
+
If the type is 3, this simply turns off the USB keyboard LEDs and returns 0.
  
Fears of global warming and its impact on our environment have left scientists scrambling to decrease levels of atmospheric carbon we humans produce. Now, Tel Aviv University researchers are doing their part to reduce humanitys carbon footprint by successfully growing forests in the most unlikely place deep in Israels Aravah Desert.
+
Otherwise, this calls KD_ForceCleanupSoCtrl internally and the flag that is set will cause all KD processes that are running (downloading, mail, NAND writing, etc.) to stop.
  
[[http://goodvillenews.com/Researchers-Nurture-Innovative-Biofuel-Crops-in-Israels-Dese-DJR.html Researchers Nurture Innovative Biofuel Crops in Israels Desert]]
+
STM calls this ioctl in the Wakeup function to "shut down KD", which can happen in the following cases:
  
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
+
* /dev/stm/immediate ioctl 0x2005 is used.
 +
* The console is idle and the DI cover polling thread has detected that the cover was closed (i.e. a disc was inserted).
 +
* The console is idle and a GPIO event handler is triggered (i.e. the POWER button was pressed).
  
== 5 Principles for Inner Transformation at Work ==
+
|}
 
 
People go to work to sustain themselves and produce value in the world. Yet work environments can also be stressful, filled with challenging responsibilities and personalities, and feel misaligned with our most deeply cherished values. Instead of sustaining us, the workplace can sometimes feel simply draining, and at worst, unwholesome for both ourselves and the world.
 
 
 
[[http://goodvillenews.com/5-Principles-for-Inner-Transformation-at-Work-TTklKV.html 5 Principles for Inner Transformation at Work]]
 
 
 
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
 
 
 
== A Young Girl with a Big Heart and an Old Man with a Lot of Flowers ==
 
 
 
When I was very young (about ten or eleven years old), I heard that our neighbor, a retired physician, had lost his wife after a long illness. He was such a dear soul, and he had the most spectacular gardens in his backyard. The whole neighborhood could see his glorious flowers from the street. The backyard was a profusion of daisies and roses, snapdragons and lilies, hyacinths and columbines. I used to think there wasnt a flower in the world that he didnt grow.
 
 
 
[[http://goodvillenews.com/A-Young-Girl-with-a-Big-Heart-and-an-Old-Man-with-a-Lot-of-F-lg9.html A Young Girl with a Big Heart and an Old Man with a Lot of Flowers]]
 
 
 
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
 
 
 
== A Young Girl with a Big Heart and an Old Man with a Lot of Flowers ==
 
 
 
When I was very young (about ten or eleven years old), I heard that our neighbor, a retired physician, had lost his wife after a long illness. He was such a dear soul, and he had the most spectacular gardens in his backyard. The whole neighborhood could see his glorious flowers from the street. The backyard was a profusion of daisies and roses, snapdragons and lilies, hyacinths and columbines. I used to think there wasnt a flower in the world that he didnt grow.
 
 
 
[[http://goodvillenews.com/A-Young-Girl-with-a-Big-Heart-and-an-Old-Man-with-a-Lot-of-F-lg9.html A Young Girl with a Big Heart and an Old Man with a Lot of Flowers]]
 
 
 
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
 
 
 
== NASA Announces Undersea Exploration Mission ==
 
 
 
An international team of aquanauts will travel again to the bottom of the Atlantic Ocean to simulate a visit to an asteroid in the 16th expedition of NASA Extreme Environment Mission Operations (NEEMO).
 
 
 
[[http://goodvillenews.com/NASA-Announces-Undersea-Exploration-Mission-9Shwm3.html NASA Announces Undersea Exploration Mission]]
 
  
[[http://goodvillenews.com/wk.html GoodvilleNews.com - good, positive news, inspirational stories, articles]]
+
[[Category:Wii Filesystem]]

Latest revision as of 01:27, 10 July 2022

The main WiiConnect24 calls are done through this device.

Ioctl listing

Inbuf addr & 3 is written to outbuf for most or all ioctls.

Request number Name Input Output Notes
1 ExecSuspendScheduler none 4 bytes
2 ExecTrySuspendScheduler 32 bytes 32 bytes
3 ExecResumeScheduler none 4+ bytes
4 KD_GetTimeTriggers ? 12 bytes Writes the time triggers for the minutes of the hour for when KD_Download and KD_CheckMail are triggered to outbuf + 4.
5 ? ? 4+ bytes
6 NWC24iStartupSocket none 32 bytes
7 NWC24iCleanupSocket none 32 bytes
8 NWC24iLockSocket none 32 bytes
9 NWC24iUnlockSocket none 32 bytes
0xa NWC24iCheckMailNow none 32 bytes
0xb NWC24iSendMailNow none 8+ bytes Connect and send mail?
0xc NWC24iReceiveMailNow ? 8+ bytes
0xd NWC24iSaveMailNow none 32 bytes Saves temporary dlcnt.bin mail content to wc24recv.mbx immediately. Actual outbuf size is 4, outbuf+0 is KD_SaveMail/KD_ProcessMail retval.
0xe NWC24iDownloadNowEx 32 bytes 32 bytes inbuf + 0 u32 is flags, inbuf + 6 u16 is nwc24dl.bin entry index, inbuf + 8 u32 is subTask bitmask. Starting at outbuf + 8 is a buffer of unknown size. Flags bit 1 must be set to manually specify a task/entry. When clear, a task is chosen automatically with the same mechanism used for choosing a task in the background.(When bit 1 is clear with this ioctl from Broadway, nothing will be downloaded since no entries will be ready for download due to dl frequencies fields.) subTask bitmap is a bitmap of subTasks to download when flags bit 2 is set, so setting bit 0 will download subTask zero, and so on. When flags is negative with bit 31 set, KD will sync the current UTC time with the time server. Outbuf+0 is KD_Download retval.
0xf NWC24iRequestGenerateUserId none 32 bytes
0x10 NWC24iRequestRegisterUserId none 32 bytes
0x1e NWC24iGetSchedulerStat none none
0x1f NWC24iSetFilterMode 32 bytes 32 bytes
0x20 NWC24iSetDebugMode 32 bytes 32 bytes
0x21 KD_SetNextWakeup 4 bytes 4 bytes Input is a u32 determining the seconds till next time STM_Wakeup is called.
0x22 NWC24iSetScriptMode 32 bytes 32 bytes
0x28 (async?) NWC24iRequestShutdown 8 bytes 4 bytes Input is a u32 for the event type.

Set a shutdown event flag.

If the type is 3, this simply turns off the USB keyboard LEDs and returns 0.

Otherwise, this calls KD_ForceCleanupSoCtrl internally and the flag that is set will cause all KD processes that are running (downloading, mail, NAND writing, etc.) to stop.

STM calls this ioctl in the Wakeup function to "shut down KD", which can happen in the following cases:

  • /dev/stm/immediate ioctl 0x2005 is used.
  • The console is idle and the DI cover polling thread has detected that the cover was closed (i.e. a disc was inserted).
  • The console is idle and a GPIO event handler is triggered (i.e. the POWER button was pressed).