flat assembler
Message board for the users of flat assembler.

Index > OS Construction > shutdown os, acpi?

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
a115433



Joined: 05 Mar 2010
Posts: 144
a115433 05 Mar 2010, 22:14
how do i shutdown os?
where should i search for this info, wich manual?

i need some info about acpi, i guess its used for shutdown. what is reset signal? what is a signal anyway?
Post 05 Mar 2010, 22:14
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
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.
Post 05 Mar 2010, 22:26
View user's profile Send private message Visit poster's website Reply with quote
a115433



Joined: 05 Mar 2010
Posts: 144
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 ;/
Post 05 Mar 2010, 23:05
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
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...:/
Post 05 Mar 2010, 23:11
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 06 Mar 2010, 00:32
Post 06 Mar 2010, 00:32
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 794
Location: Adelaide
sinsi 06 Mar 2010, 00:40
You can use the BIOS APM functions (int 15h, AX=53xx) from DOS
Post 06 Mar 2010, 00:40
View user's profile Send private message Reply with quote
a115433



Joined: 05 Mar 2010
Posts: 144
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?
Post 06 Mar 2010, 08:30
View user's profile Send private message Reply with quote
XanClic



Joined: 06 Sep 2009
Posts: 16
Location: Germany
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.
Post 06 Mar 2010, 09:52
View user's profile Send private message Visit poster's website Reply with quote
a115433



Joined: 05 Mar 2010
Posts: 144
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.
Post 06 Mar 2010, 10:09
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
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?
Post 06 Mar 2010, 12:54
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
a115433



Joined: 05 Mar 2010
Posts: 144
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.
Post 06 Mar 2010, 13:01
View user's profile Send private message Reply with quote
sinsi



Joined: 10 Aug 2007
Posts: 794
Location: Adelaide
sinsi 06 Mar 2010, 13:39
Post 06 Mar 2010, 13:39
View user's profile Send private message Reply with quote
XanClic



Joined: 06 Sep 2009
Posts: 16
Location: Germany
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? Confused

C is a nice language. As for me, I like C more than Assembly, because I know the compiler optimizes better than me. Wink
Post 06 Mar 2010, 14:34
View user's profile Send private message Visit poster's website Reply with quote
Coddy41



Joined: 18 Jan 2009
Posts: 384
Location: Ohio, USA
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)
Post 06 Mar 2010, 14:52
View user's profile Send private message Visit poster's website Reply with quote
a115433



Joined: 05 Mar 2010
Posts: 144
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 Sad Sad
Post 06 Mar 2010, 15:14
View user's profile Send private message Reply with quote
cthug



Joined: 03 Apr 2009
Posts: 36
Location: /home/Australia
cthug 07 Mar 2010, 07:02
a115433 wrote:

i refuse to use software im incapable of installing (ddk/visual studio?).


haha when I used Windows, that would drive me nuts Smile.

a115433 wrote:

asm will run only on 1 hardware. c will run not only on 1 hardware but only on 1 compiler. and its limited.


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:

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


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 Evil or Very Mad. 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
Post 07 Mar 2010, 07:02
View user's profile Send private message Visit poster's website Reply with quote
XanClic



Joined: 06 Sep 2009
Posts: 16
Location: Germany
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. Wink

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. Wink
Post 07 Mar 2010, 09:31
View user's profile Send private message Visit poster's website Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 501
Location: Belarus
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
Post 07 Mar 2010, 10:47
View user's profile Send private message Reply with quote
a115433



Joined: 05 Mar 2010
Posts: 144
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! Very Happy
Post 07 Mar 2010, 11:24
View user's profile Send private message Reply with quote
XanClic



Joined: 06 Sep 2009
Posts: 16
Location: Germany
XanClic 07 Mar 2010, 17:05
a115433 wrote:
and afair when i used -O3 guess what happend. general protection fault! yeah, c FTW! Very Happy

As said, my code works. Wink

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?
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.

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. Wink


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. Very Happy
(which is btw optimized for pipelines and so on, but it took several hours in order to write that and get it working properly)
Post 07 Mar 2010, 17:05
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.