flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > shutdown os, acpi? Goto page 1, 2 Next |
Author |
|
edfed 05 Mar 2010, 22:26
you can go to intel site.
they give the datasheets about theirs chipsets. for other manufacturers, i don't know, but they mainly respect the intel spec because it is standard spec, more or less. |
|||
05 Mar 2010, 22:26 |
|
a115433 05 Mar 2010, 23:05
ok i want only intel, can you give me link of info?
wich chapter of wich manual, i cant find anything ;/ |
|||
05 Mar 2010, 23:05 |
|
edfed 05 Mar 2010, 23:11
http://www.intel.com/p/en_US/support?iid=hdr+support
go there, choose your product, download datasheet, and seek in the summary. good luck! intel website is comming to be more and more nasty and boring to use...:/ |
|||
05 Mar 2010, 23:11 |
|
LocoDelAssembly 06 Mar 2010, 00:32
This doesn't work? http://www.ctyme.com/intr/rb-1404.htm
|
|||
06 Mar 2010, 00:32 |
|
sinsi 06 Mar 2010, 00:40
You can use the BIOS APM functions (int 15h, AX=53xx) from DOS
|
|||
06 Mar 2010, 00:40 |
|
a115433 06 Mar 2010, 08:30
how windows/linux do it?
they use int15? dont think so. im trying do decompile rom bios, but im having problems. i load it in IDA under 0xfffe0000, but it says 'start address is lower that end'. it is, so how do i bypass whis message? |
|||
06 Mar 2010, 08:30 |
|
XanClic 06 Mar 2010, 09:52
They use ACPI. A look to an osdev.org forum article might be interesting for you (though it's written in C): http://forum.osdev.org/viewtopic.php?t=16990
The code there uses ACPI to shutdown a computer. |
|||
06 Mar 2010, 09:52 |
|
a115433 06 Mar 2010, 10:09
thx, how retarded someone must be to write those kind of stuff in C.
at least he used byte/word/dword instead of arbitary microsoft-specyfic symbols. |
|||
06 Mar 2010, 10:09 |
|
vid 06 Mar 2010, 12:54
You'd need to know C first, in order to decide whether doing something in it is retarted or not.
BTW, wasn't there some 97-byte PE demo that was able to shut down machine? |
|||
06 Mar 2010, 12:54 |
|
a115433 06 Mar 2010, 13:01
ok, i want it another way.
acpi is a device, right? can i get list of functions it support? or something simmilar? for example: 00 - reset, 01 - shutdown, 02 - suspend. |
|||
06 Mar 2010, 13:01 |
|
sinsi 06 Mar 2010, 13:39
|
|||
06 Mar 2010, 13:39 |
|
XanClic 06 Mar 2010, 14:34
a115433 wrote: thx, how retarded someone must be to write those kind of stuff in C. Hm? What does that mean? C is a nice language. As for me, I like C more than Assembly, because I know the compiler optimizes better than me. |
|||
06 Mar 2010, 14:34 |
|
Coddy41 06 Mar 2010, 14:52
a115433 wrote: thx, how retarded someone must be to write those kind of stuff in C. Huh? C is very nice, I like ASM more, but C is much better than other languages, like C++, C# or VB. _________________ Want hosting for free for your asm project? You can PM me. (*.fasm4u.net) |
|||
06 Mar 2010, 14:52 |
|
a115433 06 Mar 2010, 15:14
x86 is complicated on its own.
c makes it even harder. i remember well those hard times i couldnt make my code run. problem wasnt in syntax, but in fuckin compiler. I dont have anything to c syntax, its ok, but compilers are written by complete retards who dont have even basic understanging of OS whey write for. Great example is windows, debug tools, driver tools, and so on (not sysinternals tools, they are ok). You can know everything about hardware programming, have iq > 300, build your own hardware, but still be unable to install this SHIT. reason? its sooo fucked up. Why not make standard c compiler that contain ALL headers with definitions of ALL structures and unions. instead we have to add -l option to compilers, write strange data in code, and whats most annoying, compilers are diffrent, so code written for one doesnt work under 2. And i refuse to use software im incapable of installing (ddk/visual studio?). asm will run only on 1 hardware. c will run not only on 1 hardware but only on 1 compiler. and its limited. winner? ASM. and dont forget, someone whos learning will get just frustrated when he find HLL code of hardware programming problem. and this lack of decent documentation, no wonder that new software is low quality, creators are stupid because they dont have enough knowleadge. i was the same, i was trying to write apps that work. now i could point every line of my old code and say its either wrong, inefficient, or useless. 1. learn hardware + os 2. develop tools like compilers and fuck you all who know c++ from school but have no idea how it works on machine level, you suck and make my life hard |
|||
06 Mar 2010, 15:14 |
|
cthug 07 Mar 2010, 07:02
a115433 wrote:
haha when I used Windows, that would drive me nuts . a115433 wrote:
Asm is not standardised, like fasm doesn't compile nasm code, but I see where you are coming from, HLL's should be standardised across all compilers (C at least has some standards), one of the worst is BASIC. a115433 wrote:
They taught javascript in the programming class at my high school, the teacher had to refer to a textbook to teach us what binary is . I don't like C++, OOP is too high level for me. I prefer C (I like assembly better), it is high level and easy to understand, but lower than C++ and many other HLL's. _________________ "There are only two industries that refer to their customers as 'users'." Edward Tufte |
|||
07 Mar 2010, 07:02 |
|
XanClic 07 Mar 2010, 09:31
Well, a115433, I don't know which compiler you used, but gcc is good (at least in version 4.x). Remember that it's the Linux standard compiler, thus it cannot be useless for OS development.
And if you say the compiler doesn't do what you want it to do -- as stated above, I love the compiler because it optimizes better than I could ever do. But it will of course optimize also things, which shouldn't be optimized so you have to tell it, where these things are (e.g., using the volatile keyword or using things like asm volatile ("" ::: "memory"); in gcc to keep the instructions in order). My kernel is compiled with -O3 in gcc, that's the highest optimization possible. And I got the compiler to do what I want it to do. |
|||
07 Mar 2010, 09:31 |
|
zhak 07 Mar 2010, 10:47
why you think it optimizes better? does it know if you want size optimization or speed optimization? those are very different things
|
|||
07 Mar 2010, 10:47 |
|
a115433 07 Mar 2010, 11:24
what do you mean by optimize?
everything is exactly as i would to it in pure asm, + loads of CRT functions wich do ...nothing? just compile something under windows GCC. you get loads of msvcrt.dll functions before code. what do they do? they ARE, they EXIST, they are NOT NEEDED by anything beside compiler. arithmetics is exactly as asm, cmp's, test's and jcc. function calls - also loads of crap there. what about imports? it create jump table. ok i understand its hard to do it right, but come on, this suck. and afair when i used -O3 guess what happend. general protection fault! yeah, c FTW! |
|||
07 Mar 2010, 11:24 |
|
XanClic 07 Mar 2010, 17:05
a115433 wrote: and afair when i used -O3 guess what happend. general protection fault! yeah, c FTW! As said, my code works. zhak wrote: why you think it optimizes better? does it know if you want size optimization or speed optimization? those are very different things Of course it knows. -O3 is the best speed optimization (-O2 is weaker and I think -O1 is the default (-O0 means no optimization)). -Os means size optimization. -O3 makes your code very big. For example I have a "for" loop in there which goes from 0 to 5. GCC unfolds that "for" loop thus making my kernel a lot bigger, but also faster. a115433 wrote: everything is exactly as i would to it in pure asm, + loads of CRT functions wich do ...nothing? Well, these functions don't exist when writing a kernel (with -ffreestanding and all that), of course. Furthermore, if you say it generates exactly the code you would write, you're great. But I guess, you still use "inc" and "dec" (which are in fact slower than "add ...,1" and "sub ...,1"), don't do the described loop unfolding (I guess you're using "loop") and I also doubt if you optimize all your code for the pipelines of modern processors (which GCC does, it changes the order of your code in order to remove many register dependencies -- in order to stop that, you must tell it to GCC explicitly, e.g., by using the mentioned asm statement). If you do all that, I might call you a new assembler god. But frankly, I doubt you do, and that's no offense at all. But I have to add that GCC seems to be very bad at string functions, it never uses them. Thus my strlen, strcpy, memset and so on are all written in assembly -- flat assembly of course. (which is btw optimized for pipelines and so on, but it took several hours in order to write that and get it working properly) |
|||
07 Mar 2010, 17:05 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.